From 5b0817bcb609a09efba22079ddbc3cf8c1a3ac02 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:32:21 +0200 Subject: [PATCH] [No-auto] bin/core/ref: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- bin/core/imag-ref/src/main.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/bin/core/imag-ref/src/main.rs b/bin/core/imag-ref/src/main.rs index b117aae8..585c69f4 100644 --- a/bin/core/imag-ref/src/main.rs +++ b/bin/core/imag-ref/src/main.rs @@ -69,24 +69,22 @@ fn main() { &version, "Reference files outside of the store", build_ui); - rt.cli() - .subcommand_name() - .map(|name| { - debug!("Call: {}", name); - match name { - "deref" => deref(&rt), - "create" => create(&rt), - "remove" => remove(&rt), - "list-dead" => list_dead(&rt), - other => { - debug!("Unknown command"); - let _ = rt.handle_unknown_subcommand("imag-ref", 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 { + "deref" => deref(&rt), + "create" => create(&rt), + "remove" => remove(&rt), + "list-dead" => list_dead(&rt), + other => { + debug!("Unknown command"); + let _ = rt.handle_unknown_subcommand("imag-ref", other, rt.cli()) + .map_err_trace_exit_unwrap() + .code() + .map(::std::process::exit); + }, + }; + } } fn deref(rt: &Runtime) {