clippy: deal with let bindings

In the auth code we rather #[allow] the binding, because in
this case we explicitly want to assert the type.

In fact, it would make more sense for clippy to not warn
about a unit type if the unit type is explicitly spelled
out.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-07-28 10:08:08 +02:00
parent 8e70d421f2
commit 10dac69391
5 changed files with 8 additions and 8 deletions

View File

@ -105,6 +105,7 @@ fn authenticate_user(
}
}
#[allow(clippy::let_unit_value)]
let _: () = crate::auth::authenticate_user(userid, password)?;
Ok(match crate::config::tfa::login_challenge(userid)? {
@ -122,6 +123,7 @@ fn authenticate_2nd(
.verify_with_time_frame(public_auth_key(), "PBS", Some(userid.as_str()), -60..600)?
.require_partial()?;
#[allow(clippy::let_unit_value)]
let _: () = crate::config::tfa::verify_challenge(userid, &challenge, response.parse()?)?;
Ok(AuthResult::CreateTicket)

View File

@ -29,6 +29,7 @@ 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))?;
}

View File

@ -883,14 +883,13 @@ pub fn verify(
}
res
} else if let Some(backup_group) = backup_group {
let failed_dirs = verify_backup_group(
verify_backup_group(
&verify_worker,
&backup_group,
&mut StoreProgress::new(1),
worker.upid(),
Some(&move |manifest| verify_filter(ignore_verified, outdated_after, manifest)),
)?;
failed_dirs
)?
} else {
let owner = if owner_check_required {
Some(&auth_id)

View File

@ -373,7 +373,7 @@ async fn order_certificate(
);
}
let _: () = result?;
result?;
}
task_log!(worker, "All domains validated");

View File

@ -280,12 +280,10 @@ async fn pull(
);
let pull_future = pull_store(&worker, &client, pull_params);
let future = select! {
(select! {
success = pull_future.fuse() => success,
abort = worker.abort_future().map(|_| Err(format_err!("pull aborted"))) => abort,
};
let _ = future?;
})?;
task_log!(worker, "pull datastore '{}' end", store);