Browse Source

dyn trait -> impl trait

pbs
jake 5 years ago
parent
commit
704d6386f7
  1. 2
      src/login/login.rs

2
src/login/login.rs

@ -56,7 +56,7 @@ impl SendServerPacket for SendLoginPacket {
} }
pub fn get_login_status(entity_gateway: &dyn EntityGateway, pkt: &Login) -> Result<UserAccount, AccountStatus> {
pub fn get_login_status(entity_gateway: &impl EntityGateway, pkt: &Login) -> Result<UserAccount, AccountStatus> {
let username = array_to_utf8(pkt.username).map_err(|_err| AccountStatus::Error)?; 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 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 user = entity_gateway.get_user_by_name(username).ok_or(AccountStatus::InvalidUser)?;

Loading…
Cancel
Save