diff --git a/src/controllers/openid_controller.rs b/src/controllers/openid_controller.rs index 2d938cd..a9137de 100644 --- a/src/controllers/openid_controller.rs +++ b/src/controllers/openid_controller.rs @@ -289,8 +289,7 @@ pub async fn token( &query, "invalid_request", &format!( - "Authorization header does not start with 'Basic ', got '{:#?}'", - v + "Authorization header does not start with 'Basic ', got '{v:#?}'" ), )); } @@ -538,10 +537,7 @@ fn user_info_error(err: &str, description: &str) -> HttpResponse { HttpResponse::Unauthorized() .insert_header(( "WWW-Authenticate", - format!( - "Bearer error=\"{}\", error_description=\"{}\"", - err, description - ), + format!("Bearer error=\"{err}\", error_description=\"{description}\""), )) .finish() } diff --git a/src/data/action_logger.rs b/src/data/action_logger.rs index 3a951eb..f4189f5 100644 --- a/src/data/action_logger.rs +++ b/src/data/action_logger.rs @@ -70,11 +70,8 @@ impl<'a> Action<'a> { user.quick_identity() ), Action::LoginWebauthnAttempt { success, user_id } => match success { - true => format!( - "successfully performed webauthn attempt for user {:?}", - user_id - ), - false => format!("performed FAILED webauthn attempt for user {:?}", user_id), + true => format!("successfully performed webauthn attempt for user {user_id:?}"), + false => format!("performed FAILED webauthn attempt for user {user_id:?}"), }, Action::Signout => "signed out".to_string(), Action::UserNeed2FAOnLogin(user) => { @@ -90,16 +87,14 @@ impl<'a> Action<'a> { "successfully authenticated as {}, but need to set a new password", user.quick_identity() ), - Action::TryLoginWithDisabledAccount(login) => format!( - "successfully authenticated as {}, but this is a DISABLED ACCOUNT", - login - ), - Action::FailedLoginWithBadCredentials(login) => format!( - "attempted to authenticate as {} but with a WRONG PASSWORD", - login - ), + Action::TryLoginWithDisabledAccount(login) => { + format!("successfully authenticated as {login}, but this is a DISABLED ACCOUNT") + } + Action::FailedLoginWithBadCredentials(login) => { + format!("attempted to authenticate as {login} but with a WRONG PASSWORD") + } Action::UserChangedPasswordOnLogin(user_id) => { - format!("set a new password at login as user {:?}", user_id) + format!("set a new password at login as user {user_id:?}") } Action::OTPLoginAttempt { user, success } => match success { true => format!( @@ -120,7 +115,7 @@ impl<'a> Action<'a> { "added a new factor to his account : {}", factor.quick_description(), ), - Action::Removed2FAFactor { factor_id } => format!("Removed his factor {:?}", factor_id), + Action::Removed2FAFactor { factor_id } => format!("Removed his factor {factor_id:?}"), } } } diff --git a/src/data/users_file_entity.rs b/src/data/users_file_entity.rs index 46b4052..b7c08c6 100644 --- a/src/data/users_file_entity.rs +++ b/src/data/users_file_entity.rs @@ -13,7 +13,7 @@ impl EntityManager { F: FnOnce(User) -> User, { let user = match self.find_by_user_id(id)? { - None => return new_error(format!("Failed to find user {:?}", id)), + None => return new_error(format!("Failed to find user {id:?}")), Some(user) => user, }; @@ -134,8 +134,7 @@ impl UsersSyncBackend for EntityManager { let user = match self.find_by_user_id(id)? { None => { return new_error(format!( - "Could not delete account {:?} because it was not found!", - id + "Could not delete account {id:?} because it was not found!" )); } Some(s) => s, diff --git a/src/utils/string_utils.rs b/src/utils/string_utils.rs index 10a9fa3..c508dfd 100644 --- a/src/utils/string_utils.rs +++ b/src/utils/string_utils.rs @@ -24,8 +24,8 @@ pub fn apply_env_vars(val: &str) -> String { let value = match std::env::var(varname) { Ok(v) => v, Err(e) => { - log::error!("Failed to find environment variable {}!", varname); - eprintln!("Failed to find environment variable! {:?}", e); + log::error!("Failed to find environment variable {varname}!"); + eprintln!("Failed to find environment variable! {e:?}"); std::process::exit(2); } };