more fixes for older rustc
authorGeoffrey Allott <geoffrey@allott.email>
Tue, 23 Mar 2021 20:21:46 +0000 (20:21 +0000)
committerGeoffrey Allott <geoffrey@allott.email>
Tue, 23 Mar 2021 20:21:46 +0000 (20:21 +0000)
src/client.rs

index 1cc8618a27ee32962785ad3a5b5b47470c3a4cef..643be3feb53e6d8a45160e020abd7b0146d328f5 100644 (file)
@@ -121,8 +121,8 @@ impl ConnectionState {
                 self.client = ClientState::LoginAuthIssued { username, challenge: challenge.clone() };
                 ServerMessage::LoginAuthChallenge { challenge }
             }
-            (&mut ClientState::LoginAuthIssued { username, ref challenge }, ClientMessage::LoginAuthResponse { signature }) => {
-                if self.server.verify(username, &challenge, &signature).await {
+            (&mut ClientState::LoginAuthIssued { username, ref challenge }, ClientMessage::LoginAuthResponse { ref signature }) => {
+                if self.server.verify(username, &challenge, signature).await {
                     self.client = ClientState::LoggedIn { username, state: LoggedInState::Idle };
                     ServerMessage::LoginSuccess
                 } else {
@@ -168,11 +168,12 @@ impl ConnectionState {
                     (Err(err), _, _) | (_, Err(err), _) | (_, _, Err(err)) => ServerMessage::JoinGameFailure { reason: err.to_string() },
                 }
             }
-            (&mut ClientState::LoggedIn { username, state: LoggedInState::InGame { ref mut game } }, ClientMessage::TakeAction { action }) => {
+            (&mut ClientState::LoggedIn { username, state: LoggedInState::InGame { ref mut game } }, ClientMessage::TakeAction { ref action }) => {
                 let timestamp = match self.server.now().await {
                     Ok(timestamp) => timestamp,
                     Err(err) => return ServerMessage::InternalError { reason: err.to_string() },
                 };
+                let action = action.clone();
                 let action = UserAction { timestamp, username, action };
                 let id = game.id();
                 loop {