Update to code to Rust 1.67
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2023-02-02 10:22:15 +01:00
parent 107b613be5
commit f2e4826b14
4 changed files with 16 additions and 26 deletions

View File

@ -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()
}

View File

@ -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:?}"),
}
}
}

View File

@ -13,7 +13,7 @@ impl EntityManager<User> {
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<User> {
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,

View File

@ -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);
}
};