gameServer2/src/server/handlers/lobby.rs
changeset 13427 6f6a866c86a2
parent 13419 81e0ed105f5d
child 13444 914f9b970f4d
--- a/gameServer2/src/server/handlers/lobby.rs	Wed Jun 27 17:58:33 2018 +0300
+++ b/gameServer2/src/server/handlers/lobby.rs	Wed Jun 27 23:26:29 2018 +0300
@@ -43,16 +43,16 @@
                     .map(|(_, c)| c.nick.clone())
                     .collect();
                 let c = &mut server.clients[client_id];
-                actions = match room {
-                    None => vec![Warn("No such room.".to_string())],
-                    Some((_, r)) => {
-                        if c.protocol_number != r.protocol_number {
-                            vec![Warn("Room version incompatible to your Hedgewars version!".to_string())]
-                        } else {
-                            vec![MoveToRoom(r.id),
-                                 RoomJoined(nicks).send_self().action()]
-                        }
+
+                actions = if let Some((_, r)) = room {
+                    if c.protocol_number != r.protocol_number {
+                        vec![Warn("Room version incompatible to your Hedgewars version!".to_string())]
+                    } else {
+                        vec![MoveToRoom(r.id),
+                             RoomJoined(nicks).send_self().action()]
                     }
+                } else {
+                    vec![Warn("No such room.".to_string())]
                 };
             }
             server.react(client_id, actions);