Fix all default clippy warnings (#480)

All trivial, fixes were for:
 - #[deny(clippy::if_same_then_else)]
 - #[warn(clippy::explicit_auto_deref)]
 - #[warn(clippy::bool_assert_comparison)]

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Tom Martin
2022-11-17 17:09:53 +00:00
committed by GitHub
parent da19a07943
commit ba28bc94d3
26 changed files with 77 additions and 87 deletions

View File

@@ -201,7 +201,7 @@ mod tests {
.send(ActorMessage::Set {
key: "hello".to_string(),
value: 30usize,
expiry: expiry,
expiry,
})
.await;
let res = res.expect("Failed to send msg");
@@ -235,7 +235,7 @@ mod tests {
.send(ActorMessage::Set {
key: "hello".to_string(),
value: 30usize,
expiry: expiry,
expiry,
})
.await;
let res = res.expect("Failed to send msg");
@@ -246,7 +246,7 @@ mod tests {
},
_ => panic!("Shouldn't happen!"),
}
assert_eq!(addr.connected(), true);
assert!(addr.connected());
let res3 = addr.send(ActorMessage::Expire("hello".to_string())).await;
let res3 = res3.expect("Failed to send msg");
@@ -254,9 +254,7 @@ mod tests {
ActorResponse::Expire(c) => match c.await {
Ok(dur) => {
let now = Duration::from_secs(3);
if dur > now {
panic!("Expiry is invalid!");
} else if dur > now + Duration::from_secs(4) {
if dur > now || dur > now + Duration::from_secs(4) {
panic!("Expiry is invalid!");
}
}