From 1635dd46651c4980d370b0e4a248c26dbce00036 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:40:02 +0200 Subject: [PATCH] [Auto] bin/core/gps: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- bin/core/imag-gps/src/main.rs | 16 ++++++++-------- bin/core/imag-gps/src/ui.rs | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/core/imag-gps/src/main.rs b/bin/core/imag-gps/src/main.rs index ec96721b..99b4eee5 100644 --- a/bin/core/imag-gps/src/main.rs +++ b/bin/core/imag-gps/src/main.rs @@ -48,7 +48,7 @@ use std::io::Write; use std::process::exit; use std::str::FromStr; -use failure::Error; + use failure::err_msg; use libimagstore::storeid::StoreId; @@ -100,11 +100,11 @@ fn add(rt: &Runtime) { let c = { let parse = |value: &str| -> (i64, i64, i64) { debug!("Parsing '{}' into degree, minute and second", value); - let ary = value.split(".") + let ary = value.split('.') .map(|v| {debug!("Parsing = {}", v); v}) .map(FromStr::from_str) .map(|elem| { - elem.or_else(|_| Err(Error::from(err_msg("Error while converting number")))) + elem.or_else(|_| Err(err_msg("Error while converting number"))) .map_err_trace_exit_unwrap() }) .collect::>(); @@ -146,7 +146,7 @@ fn add(rt: &Runtime) { .set_coordinates(c.clone()) .map_err_trace_exit_unwrap(); - let _ = rt.report_touched(&id).unwrap_or_exit(); + rt.report_touched(&id).unwrap_or_exit(); }); } @@ -177,10 +177,10 @@ fn remove(rt: &Runtime) { .map_err_trace_exit_unwrap(); // The parsing of the deleted values failed if print_removed { - let _ = writeln!(rt.stdout(), "{}", removed_value).to_exit_code().unwrap_or_exit(); + writeln!(rt.stdout(), "{}", removed_value).to_exit_code().unwrap_or_exit(); } - let _ = rt.report_touched(&id).unwrap_or_exit(); + rt.report_touched(&id).unwrap_or_exit(); }); } @@ -205,9 +205,9 @@ fn get(rt: &Runtime) { exit(1) }); - let _ = writeln!(stdout, "{}", value).to_exit_code().unwrap_or_exit(); + writeln!(stdout, "{}", value).to_exit_code().unwrap_or_exit(); - let _ = rt.report_touched(&id).unwrap_or_exit(); + rt.report_touched(&id).unwrap_or_exit(); }) } diff --git a/bin/core/imag-gps/src/ui.rs b/bin/core/imag-gps/src/ui.rs index bd7879fe..e1107de3 100644 --- a/bin/core/imag-gps/src/ui.rs +++ b/bin/core/imag-gps/src/ui.rs @@ -103,7 +103,6 @@ impl IdPathProvider for PathProvider { fn get_id_paths(field: &str, subm: &ArgMatches) -> Result>> { subm.values_of(field) .map(|v| v - .into_iter() .map(PathBuf::from) .map(|pb| pb.into_storeid()) .collect::>>()