Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -79,10 +79,7 @@ pub async fn request_reset_password(
|
||||
match users_service::get_by_mail(&req.mail).await {
|
||||
Ok(mut user) => users_service::request_reset_password(&mut user).await?,
|
||||
Err(e) => {
|
||||
log::error!(
|
||||
"Could not locate user account {}! (error silently ignored)",
|
||||
e
|
||||
);
|
||||
log::error!("Could not locate user account {e}! (error silently ignored)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +119,7 @@ pub async fn check_reset_password_token(
|
||||
RatedAction::CheckResetPasswordTokenFailed,
|
||||
)
|
||||
.await?;
|
||||
log::error!("Password reset token could not be used: {}", e);
|
||||
log::error!("Password reset token could not be used: {e}");
|
||||
return Ok(HttpResponse::NotFound().finish());
|
||||
}
|
||||
};
|
||||
@ -156,7 +153,7 @@ pub async fn reset_password(remote_ip: RemoteIP, req: web::Json<ResetPasswordBod
|
||||
RatedAction::CheckResetPasswordTokenFailed,
|
||||
)
|
||||
.await?;
|
||||
log::error!("Password reset token could not be used: {}", e);
|
||||
log::error!("Password reset token could not be used: {e}");
|
||||
return Ok(HttpResponse::NotFound().finish());
|
||||
}
|
||||
};
|
||||
@ -196,7 +193,7 @@ pub async fn password_login(remote_ip: RemoteIP, req: web::Json<PasswordLoginQue
|
||||
let user = match users_service::get_by_mail(&req.mail).await {
|
||||
Ok(u) => u,
|
||||
Err(e) => {
|
||||
log::error!("Auth failed: could not find account by mail! {}", e);
|
||||
log::error!("Auth failed: could not find account by mail! {e}");
|
||||
rate_limiter_service::record_action(remote_ip.0, RatedAction::FailedPasswordLogin)
|
||||
.await?;
|
||||
return Ok(HttpResponse::Unauthorized().json("Invalid credentials"));
|
||||
|
@ -183,9 +183,9 @@ pub async fn import_family(
|
||||
}
|
||||
|
||||
if let Err(e) = req_member_data.to_member(member).await {
|
||||
log::error!("Error while processing import (member {:?}) - {e}", req_id);
|
||||
log::error!("Error while processing import (member {req_id:?}) - {e}");
|
||||
return Ok(
|
||||
HttpResponse::BadRequest().json(format!("Failed to validate member {:?}!", req_id))
|
||||
HttpResponse::BadRequest().json(format!("Failed to validate member {req_id:?}!"))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl Display for HttpErr {
|
||||
|
||||
impl actix_web::error::ResponseError for HttpErr {
|
||||
fn error_response(&self) -> HttpResponse<BoxBody> {
|
||||
log::error!("Error while processing request! {}", self);
|
||||
log::error!("Error while processing request! {self}");
|
||||
HttpResponse::InternalServerError().body("Failed to execute request!")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user