From b189f2628f4b04ae76eefd70c419f5a343ab6adc Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Sun, 9 Jan 2022 21:53:28 +0000 Subject: [PATCH] fix clippy warnings --- src/auth.rs | 2 +- src/client.rs | 2 +- src/dealer.rs | 4 ++-- src/game/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 621af6a..f37c2e3 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -26,7 +26,7 @@ impl Auth { match self { Auth::NoLogin => false, Auth::Plain { password } => signature == password, - Auth::Scrypt { phc } => match PasswordHash::new(&phc) { + Auth::Scrypt { phc } => match PasswordHash::new(phc) { Ok(hash) => Scrypt.verify_password(signature.as_bytes(), &hash).is_ok(), Err(err) => { error!("Failed to parse {:?} as PHC string format specification: {}", phc, err); diff --git a/src/client.rs b/src/client.rs index a67df2c..26df261 100644 --- a/src/client.rs +++ b/src/client.rs @@ -122,7 +122,7 @@ impl ConnectionState { ServerMessage::LoginAuthChallenge { challenge } } (&mut ClientState::LoginAuthIssued { username, ref challenge }, ClientMessage::LoginAuthResponse { signature }) => { - if self.server.verify(username, &challenge, &signature).await { + if self.server.verify(username, challenge, &signature).await { self.client = ClientState::LoggedIn { username, state: LoggedInState::Idle }; ServerMessage::LoginSuccess } else { diff --git a/src/dealer.rs b/src/dealer.rs index 1dad802..f04b360 100644 --- a/src/dealer.rs +++ b/src/dealer.rs @@ -138,8 +138,8 @@ impl Dealer { let game = &mut self.dealer.game; match self.server.take_action(game.id(), game.actions_len(), &action).await? { ActionStatus::Committed => match game.take_action(action) { - Ok(()) => return Ok(ActionStatus::Committed), - Err(err) => return Err(RedisError::from((ErrorKind::ClientError, "Invalid action", err.to_string()))), + Ok(()) => Ok(ActionStatus::Committed), + Err(err) => Err(RedisError::from((ErrorKind::ClientError, "Invalid action", err.to_string()))), }, ActionStatus::Interrupted => { debug!("Action {:?} was interrupted", action); diff --git a/src/game/mod.rs b/src/game/mod.rs index d06ca9d..3736c56 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -97,7 +97,7 @@ impl GameList { } pub fn matches(&self, game: &GameSummary) -> bool { - self.filter.matches(&game) + self.filter.matches(game) } } -- 2.34.1