fix server build
authoralfadur
Mon, 12 Feb 2024 21:26:35 +0300
changeset 16017 0b2e0a7d0431
parent 16016 b26c3497ea85
child 16018 fb389df02e3e
fix server build
rust/hedgewars-server/src/core/server.rs
--- a/rust/hedgewars-server/src/core/server.rs	Mon Feb 12 21:01:21 2024 +0300
+++ b/rust/hedgewars-server/src/core/server.rs	Mon Feb 12 21:26:35 2024 +0300
@@ -620,7 +620,7 @@
     }
 
     fn remove_from_room(&mut self, client_id: ClientId) -> LeaveRoomResult {
-        let Some((client, room)) = self.server.client_and_room_mut(client_id);
+        let (client, room) = self.server.client_and_room_mut(client_id).expect("Caller should have ensured the client is in this room");
         room.players_number -= 1;
         client.room_id = None;
 
@@ -801,7 +801,7 @@
                 let pro = i.clone().filter(|(_, v)| *v).count();
                 let contra = i.filter(|(_, v)| !*v).count();
                 let success_quota = voting.voters.len() / 2 + 1;
-                
+
                 if vote.is_forced && vote.is_pro || pro >= success_quota {
                     let voting = self.room_mut().voting.take().unwrap();
                     if let Some(effect) = self.apply_vote(voting.kind) {