properly scope clippy allow

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-08-02 11:09:40 +02:00
parent d2ff521df2
commit 75ecc27907
2 changed files with 10 additions and 4 deletions

View File

@ -106,7 +106,9 @@ fn authenticate_user(
}
#[allow(clippy::let_unit_value)]
let _: () = crate::auth::authenticate_user(userid, password)?;
{
let _: () = crate::auth::authenticate_user(userid, password)?;
}
Ok(match crate::config::tfa::login_challenge(userid)? {
None => AuthResult::CreateTicket,
@ -124,7 +126,9 @@ fn authenticate_2nd(
.require_partial()?;
#[allow(clippy::let_unit_value)]
let _: () = crate::config::tfa::verify_challenge(userid, &challenge, response.parse()?)?;
{
let _: () = crate::config::tfa::verify_challenge(userid, &challenge, response.parse()?)?;
}
Ok(AuthResult::CreateTicket)
}

View File

@ -30,8 +30,10 @@ fn tfa_update_auth(
if authid.user() != Userid::root_userid() {
let password = password.ok_or_else(|| http_err!(UNAUTHORIZED, "missing password"))?;
#[allow(clippy::let_unit_value)]
let _: () = crate::auth::authenticate_user(authid.user(), &password)
.map_err(|err| http_err!(UNAUTHORIZED, "{}", err))?;
{
let _: () = crate::auth::authenticate_user(authid.user(), &password)
.map_err(|err| http_err!(UNAUTHORIZED, "{}", err))?;
}
}
// After authentication, verify that the to-be-modified user actually exists: