From 56a4b8c3627e6a44a52d3fb4ee6052e7f0f60482 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 14 Feb 2022 01:56:52 +0100 Subject: [PATCH] Fix nick and room checks --- cove-server/src/util.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cove-server/src/util.rs b/cove-server/src/util.rs index 3d48c41..2c71fcf 100644 --- a/cove-server/src/util.rs +++ b/cove-server/src/util.rs @@ -13,7 +13,7 @@ pub fn timestamp_after(previous: u128) -> u128 { } pub fn check_room(room: &str) -> Option { - if !room.is_empty() { + if room.is_empty() { return Some("is empty".to_string()); } if !room.is_ascii() { @@ -32,10 +32,10 @@ pub fn check_room(room: &str) -> Option { } pub fn check_nick(nick: &str) -> Option { - if !nick.is_empty() { + if nick.is_empty() { return Some("is empty".to_string()); } - if !nick.trim().is_empty() { + if nick.trim().is_empty() { return Some("contains only whitespace".to_string()); } let nick = nick.trim();