summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:40:02 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commit1635dd46651c4980d370b0e4a248c26dbce00036 (patch)
tree8cb8a3e6f71dd97854ea8217f54d021f2b90e197 /bin
parent451020187eb72c24371829192f7a508ea017cdf4 (diff)
[Auto] bin/core/gps: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin')
-rw-r--r--bin/core/imag-gps/src/main.rs16
-rw-r--r--bin/core/imag-gps/src/ui.rs1
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::<Vec<i64>>();
@@ -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<Option<Vec<StoreId>>> {
subm.values_of(field)
.map(|v| v
- .into_iter()
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>>>()