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

View file

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