From fd3168e9f968e73106531f401806b01bb7d6d74d Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 7 Jan 2020 21:39:18 -0800 Subject: [PATCH] option filters: is_none -> is_some --- src/ship/location.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ship/location.rs b/src/ship/location.rs index a852dce..35a60a4 100644 --- a/src/ship/location.rs +++ b/src/ship/location.rs @@ -192,7 +192,7 @@ impl ClientLocation { let in_lobby = self.lobbies.iter() .any(|k| k.contains(id)); let in_room = self.rooms.iter() - .filter(|k| k.is_none()) + .filter(|k| k.is_some()) .map(|k| k.unwrap()) .any(|k| k.contains(id)); @@ -216,7 +216,7 @@ impl ClientLocation { self.err_if_client_is_in_area(id, CreateRoomError::ClientInAreaAlready)?; let (room_id, empty_room) = self.rooms.iter_mut() .enumerate() - .filter(|(_, k)| k.is_none()) + .filter(|(_, k)| k.is_some()) .nth(0) .ok_or(CreateRoomError::NoOpenSlots)?; @@ -265,7 +265,7 @@ impl ClientLocation { } self.rooms.iter_mut() - .filter(|lobby| lobby.is_none()) + .filter(|lobby| lobby.is_some()) .map(|lobby| lobby.unwrap()) .map(|mut lobby| lobby.remove(id)) .any(|k| k);