tree wide: clippy lint fixes

most (not all) where done automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-06-02 15:59:53 +02:00
parent c39852abdc
commit fbfb64a6b2
21 changed files with 34 additions and 46 deletions

View File

@ -163,7 +163,7 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
let path = required_string_param(&param, "snapshot")?;
let archive_name = required_string_param(&param, "archive-name")?;
let backup_dir = dir_or_last_from_group(&client, &repo, &backup_ns, &path).await?;
let backup_dir = dir_or_last_from_group(&client, &repo, &backup_ns, path).await?;
let crypto = crypto_parameters(&param)?;

View File

@ -176,7 +176,7 @@ pub async fn dir_or_last_from_group(
match path.parse::<BackupPart>()? {
BackupPart::Dir(dir) => Ok(dir),
BackupPart::Group(group) => {
api_datastore_latest_snapshot(&client, repo.store(), ns, group).await
api_datastore_latest_snapshot(client, repo.store(), ns, group).await
}
}
}
@ -1245,7 +1245,7 @@ async fn restore(param: Value) -> Result<Value, Error> {
let ns = optional_ns_param(&param)?;
let path = json::required_string_param(&param, "snapshot")?;
let backup_dir = dir_or_last_from_group(&client, &repo, &ns, &path).await?;
let backup_dir = dir_or_last_from_group(&client, &repo, &ns, path).await?;
let target = json::required_string_param(&param, "target")?;
let target = if target == "-" { None } else { Some(target) };

View File

@ -205,7 +205,7 @@ async fn mount_do(param: Value, pipe: Option<Fd>) -> Result<Value, Error> {
let backup_ns = optional_ns_param(&param)?;
let path = required_string_param(&param, "snapshot")?;
let backup_dir = dir_or_last_from_group(&client, &repo, &backup_ns, &path).await?;
let backup_dir = dir_or_last_from_group(&client, &repo, &backup_ns, path).await?;
let keyfile = param["keyfile"].as_str().map(PathBuf::from);
let crypt_config = match keyfile {