From 0e2d6cd3b10ef965ec3f6caa8831ddcfef081d28 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 22 Jun 2021 23:23:22 +0000 Subject: [PATCH] don't expect people to remember null in Rust --- src/ship/packet/handler/room.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ship/packet/handler/room.rs b/src/ship/packet/handler/room.rs index 8841d87..a058f9a 100644 --- a/src/ship/packet/handler/room.rs +++ b/src/ship/packet/handler/room.rs @@ -22,22 +22,22 @@ pub fn create_room(id: ClientId, match room::Difficulty::try_from(create_room.difficulty)? { room::Difficulty::Ultimate => { if level < 80 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 80 \nto create Ultimate rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 80 \nto create Ultimate rooms.".into())))].into_iter())) } }, room::Difficulty::VeryHard => { if level < 40 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 40 \nto create Very Hard rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 40 \nto create Very Hard rooms.".into())))].into_iter())) } }, room::Difficulty::Hard => { if level < 20 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto create Hard rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto create Hard rooms.".into())))].into_iter())) } }, room::Difficulty::Normal => { if level < 1 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 1 \nto create Normal rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 1 \nto create Normal rooms.".into())))].into_iter())) } }, // i can't believe you've done this @@ -99,22 +99,22 @@ pub fn join_room(id: ClientId, match room.mode.difficulty() { room::Difficulty::Ultimate => { if level < 80 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 80 \nto join Ultimate rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 80 \nto join Ultimate rooms.".into())))].into_iter())) } }, room::Difficulty::VeryHard => { if level < 40 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 40 \nto join Very Hard rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 40 \nto join Very Hard rooms.".into())))].into_iter())) } }, room::Difficulty::Hard => { if level < 20 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto join Hard rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto join Hard rooms.".into())))].into_iter())) } }, room::Difficulty::Normal => { if level < 1 { - return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 1 \nto join Normal rooms.\0".into())))].into_iter())) + return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 1 \nto join Normal rooms.".into())))].into_iter())) } }, };