From 7c85199e4c33de46490325d48d50ab4ce7c00166 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 23 Jun 2021 01:03:54 +0000 Subject: [PATCH] andy vs. clippy round 3 --- src/ship/packet/handler/room.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ship/packet/handler/room.rs b/src/ship/packet/handler/room.rs index f2ff793..60339bb 100644 --- a/src/ship/packet/handler/room.rs +++ b/src/ship/packet/handler/room.rs @@ -35,8 +35,7 @@ pub fn create_room(id: ClientId, return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto create Hard rooms.".into())))].into_iter())) } }, - // i can't believe you've done this - _ => {unreachable!()}, + room::Difficulty::Normal => {}, }; let area = client_location.get_area(id).unwrap(); @@ -87,9 +86,7 @@ pub fn join_room(id: ClientId, -> Result + Send>, ShipError> { let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id))?; let level = level_table.get_level_from_exp(client.character.char_class, client.character.exp); - let room = rooms.get(pkt.item as usize) - .ok_or_else(|| ShipError::InvalidRoom(pkt.item))?.as_ref() - .ok_or_else(|| ShipError::InvalidRoom(pkt.item))?; + let room = rooms.get(pkt.item as usize).ok_or(ShipError::InvalidRoom(pkt.item))?.as_ref().unwrap(); // clippy look what you made me do match room.mode.difficulty() { room::Difficulty::Ultimate => {