clean code with clippy
This commit is contained in:
@ -99,11 +99,8 @@ ORDER BY name
|
||||
}
|
||||
|
||||
pub async fn login(db: &SqlitePool, name: String, pw: String) -> Result<Self, LoginError> {
|
||||
let user = match User::find_by_name(db, name).await {
|
||||
Some(user) => user,
|
||||
None => {
|
||||
return Err(LoginError::InvalidAuthenticationCombo); // Username not found
|
||||
}
|
||||
let Some(user) = User::find_by_name(db, name).await else {
|
||||
return Err(LoginError::InvalidAuthenticationCombo); // Username not found
|
||||
};
|
||||
|
||||
match user.pw.clone() {
|
||||
|
Reference in New Issue
Block a user