From 02947adc9804abafc91f350a1eb191440d38480f Mon Sep 17 00:00:00 2001 From: Andy Newjack Date: Tue, 26 Nov 2019 01:00:38 -0400 Subject: [PATCH] removed let banned and extra comments --- src/login/login.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/login/login.rs b/src/login/login.rs index 021a06c..9932202 100644 --- a/src/login/login.rs +++ b/src/login/login.rs @@ -60,10 +60,9 @@ pub fn get_login_status(entity_gateway: &dyn EntityGateway, pkt: &Login) -> Resu let username = array_to_utf8(pkt.username).map_err(|_err| AccountStatus::Error)?; let password = array_to_utf8(pkt.password).map_err(|_err| AccountStatus::Error)?; let user = entity_gateway.get_user_by_name(username).ok_or(AccountStatus::InvalidUser)?; - let banned = user.banned; let verified = bcrypt::verify(password, user.password.as_str()).map_err(|_err| AccountStatus::Error)?; match verified { - true => if banned { + true => if user.banned { Err(AccountStatus::Banned) } else { @@ -306,7 +305,7 @@ mod test { flags: 0, }) } - } // end impl EntityGateway for TestData + } let mut server = LoginServerState::new(TestData {}); let send = server.handle(ClientId(1), &LOGIN_PACKET).unwrap().collect::>(); @@ -327,5 +326,5 @@ mod test { }, caps: 258 }))]) - } // end test_banned_user() + } }