try if-let
This commit is contained in:
parent
c8a6823b82
commit
7a3f0db3bf
@ -336,9 +336,9 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> {
|
|||||||
|
|
||||||
let pkt = match self.client_location.get_area(id).unwrap() {
|
let pkt = match self.client_location.get_area(id).unwrap() {
|
||||||
RoomLobby::Room(room) => {
|
RoomLobby::Room(room) => {
|
||||||
self.client_location.get_client_neighbors(id).map(|x| if x.len() == 0 {
|
if let 0 = neighbors.len() {
|
||||||
self.rooms[room.0] = None
|
self.rooms[room.0] = None;
|
||||||
});
|
}
|
||||||
let leader = self.client_location.get_room_leader(room).unwrap();
|
let leader = self.client_location.get_room_leader(room).unwrap();
|
||||||
SendShipPacket::LeaveRoom(LeaveRoom::new(client.local_client.id(), leader.local_client.id()))
|
SendShipPacket::LeaveRoom(LeaveRoom::new(client.local_client.id(), leader.local_client.id()))
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user