tree wide: some stylistic clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-04-10 18:33:32 +02:00
parent b22d785c18
commit 12558e0dde
9 changed files with 25 additions and 28 deletions

View File

@ -453,7 +453,8 @@ async fn ls(
.noheader(true)
.sortby("name", false);
let res = get_api_children(path.unwrap_or(String::from("/")), rpcenv).await?;
let path = path.unwrap_or_else(|| "".into());
let res = get_api_children(path, rpcenv).await?;
format_and_print_result_full(
&mut serde_json::to_value(res)?,

View File

@ -119,7 +119,7 @@ fn inspect_chunk(
let chunk_path = Path::new(&chunk);
if digest.is_none() && use_filename_as_digest {
digest = Some(if let Some((_, filename)) = chunk.rsplit_once("/") {
digest = Some(if let Some((_, filename)) = chunk.rsplit_once('/') {
String::from(filename)
} else {
chunk.clone()