summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:31:13 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commitcba336e1dd97cb23ac2fdce9bc05e5ea7e91bbf9 (patch)
tree7dd4e0a44af58edc289dd13ad7215e7bc31c4d16
parent846304e6879d7fcd5c8385f0ee8639640a67a8d5 (diff)
[No-auto] bin/core/category: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/core/imag-category/src/main.rs36
1 files changed, 17 insertions, 19 deletions
diff --git a/bin/core/imag-category/src/main.rs b/bin/core/imag-category/src/main.rs
index 76bc593b..44a87c12 100644
--- a/bin/core/imag-category/src/main.rs
+++ b/bin/core/imag-category/src/main.rs
@@ -70,25 +70,23 @@ fn main() {
"Add a category to entries and manage categories",
ui::build_ui);
- rt.cli()
- .subcommand_name()
- .map(|name| {
- match name {
- "set" => set(&rt),
- "get" => get(&rt),
- "list-category" => list_category(&rt),
- "create-category" => create_category(&rt),
- "delete-category" => delete_category(&rt),
- "list-categories" => list_categories(&rt),
- other => {
- debug!("Unknown command");
- let _ = rt.handle_unknown_subcommand("imag-category", other, rt.cli())
- .map_err_trace_exit_unwrap()
- .code()
- .map(::std::process::exit);
- },
- }
- });
+ if let Some(name) = rt.cli().subcommand_name() {
+ match name {
+ "set" => set(&rt),
+ "get" => get(&rt),
+ "list-category" => list_category(&rt),
+ "create-category" => create_category(&rt),
+ "delete-category" => delete_category(&rt),
+ "list-categories" => list_categories(&rt),
+ other => {
+ debug!("Unknown command");
+ let _ = rt.handle_unknown_subcommand("imag-category", other, rt.cli())
+ .map_err_trace_exit_unwrap()
+ .code()
+ .map(::std::process::exit);
+ },
+ }
+ }
}
fn set(rt: &Runtime) {