[No-auto] bin/domain/mail: Fix Clippy warnings

Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
flip1995 2019-08-27 10:15:03 +02:00 committed by Matthias Beyer
parent 009539dfd3
commit 3036d87402
2 changed files with 15 additions and 17 deletions

View file

@ -80,23 +80,21 @@ fn main() {
"Mail collection tool",
build_ui);
rt.cli()
.subcommand_name()
.map(|name| {
debug!("Call {}", name);
match name {
"import-mail" => import_mail(&rt),
"list" => list(&rt),
"mail-store" => mail_store(&rt),
other => {
debug!("Unknown command");
let _ = rt.handle_unknown_subcommand("imag-mail", other, rt.cli())
.map_err_trace_exit_unwrap()
.code()
.map(::std::process::exit);
}
if let Some(name) = rt.cli().subcommand_name() {
debug!("Call {}", name);
match name {
"import-mail" => import_mail(&rt),
"list" => list(&rt),
"mail-store" => mail_store(&rt),
other => {
debug!("Unknown command");
let _ = rt.handle_unknown_subcommand("imag-mail", other, rt.cli())
.map_err_trace_exit_unwrap()
.code()
.map(::std::process::exit);
}
});
}
}
}
fn import_mail(rt: &Runtime) {

View file

@ -87,7 +87,7 @@ impl IdPathProvider for PathProvider {
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>>>()
)
.unwrap_or(Ok(Vec::new()))
.unwrap_or_else(|| Ok(Vec::new()))
.map(Some)
}
}