[Auto] bin/core/gps: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
451020187e
commit
1635dd4665
2 changed files with 8 additions and 9 deletions
|
@ -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();
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -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<_>>>()
|
||||
|
|
Loading…
Reference in a new issue