mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
refactor: fix Rust 1.73 clippy warnings
This commit is contained in:
@@ -138,11 +138,7 @@ async fn poke_spec(context: &Context, spec: Option<&str>) -> bool {
|
|||||||
/* import a directory */
|
/* import a directory */
|
||||||
let dir_name = std::path::Path::new(&real_spec);
|
let dir_name = std::path::Path::new(&real_spec);
|
||||||
let dir = fs::read_dir(dir_name).await;
|
let dir = fs::read_dir(dir_name).await;
|
||||||
if dir.is_err() {
|
if let Ok(mut dir) = dir {
|
||||||
error!(context, "Import: Cannot open directory \"{}\".", &real_spec,);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
let mut dir = dir.unwrap();
|
|
||||||
while let Ok(Some(entry)) = dir.next_entry().await {
|
while let Ok(Some(entry)) = dir.next_entry().await {
|
||||||
let name_f = entry.file_name();
|
let name_f = entry.file_name();
|
||||||
let name = name_f.to_string_lossy();
|
let name = name_f.to_string_lossy();
|
||||||
@@ -154,6 +150,9 @@ async fn poke_spec(context: &Context, spec: Option<&str>) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
error!(context, "Import: Cannot open directory \"{}\".", &real_spec);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!("Import: {} items read from \"{}\".", read_cnt, &real_spec);
|
println!("Import: {} items read from \"{}\".", read_cnt, &real_spec);
|
||||||
|
|||||||
Reference in New Issue
Block a user