summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-02-05 01:37:32 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-02-11 03:52:04 +0100
commit90eaeb642af712c6dc556ad8342e6d218c892cc1 (patch)
tree54764c60307db0bd7dd43c7c6fa222f98be545dd
parent01fa19aadebbe94c6b759608e2f75f2714b74c94 (diff)
Remove magic constants in trace_unwrap_exit/map_err_trace_exit_unwrap calls
This patch removes the magic constant we used when calling `trace_unwrap_exit()` or `map_err_trace_exit_unwrap()`. We used to call it with `1` as parameter, where the number was the exit code to use. Now the implementation of the function does it automatically (using 1 (one) as exit code). All calls of these functions were fixed. Thanks to vim this was easy. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/core/imag-annotate/src/main.rs48
-rw-r--r--bin/core/imag-annotate/src/ui.rs6
-rw-r--r--bin/core/imag-category/src/main.rs30
-rw-r--r--bin/core/imag-category/src/ui.rs4
-rw-r--r--bin/core/imag-diagnostics/src/main.rs16
-rw-r--r--bin/core/imag-edit/src/main.rs10
-rw-r--r--bin/core/imag-edit/src/ui.rs2
-rw-r--r--bin/core/imag-gps/src/main.rs24
-rw-r--r--bin/core/imag-gps/src/ui.rs6
-rw-r--r--bin/core/imag-grep/src/main.rs4
-rw-r--r--bin/core/imag-ids/src/id_filters.rs2
-rw-r--r--bin/core/imag-ids/src/main.rs12
-rw-r--r--bin/core/imag-link/src/main.rs40
-rw-r--r--bin/core/imag-link/src/ui.rs9
-rw-r--r--bin/core/imag-mv/src/main.rs20
-rw-r--r--bin/core/imag-ref/src/main.rs17
-rw-r--r--bin/core/imag-store/src/create.rs5
-rw-r--r--bin/core/imag-store/src/delete.rs4
-rw-r--r--bin/core/imag-store/src/get.rs5
-rw-r--r--bin/core/imag-store/src/main.rs2
-rw-r--r--bin/core/imag-store/src/retrieve.rs6
-rw-r--r--bin/core/imag-store/src/update.rs3
-rw-r--r--bin/core/imag-store/src/verify.rs5
-rw-r--r--bin/core/imag-tag/src/main.rs8
-rw-r--r--bin/core/imag-tag/src/ui.rs2
-rw-r--r--bin/core/imag-view/src/main.rs34
-rw-r--r--bin/core/imag-view/src/ui.rs2
-rw-r--r--bin/domain/imag-bookmark/src/main.rs22
-rw-r--r--bin/domain/imag-contact/src/create.rs21
-rw-r--r--bin/domain/imag-contact/src/main.rs42
-rw-r--r--bin/domain/imag-diary/src/create.rs9
-rw-r--r--bin/domain/imag-diary/src/delete.rs7
-rw-r--r--bin/domain/imag-diary/src/list.rs8
-rw-r--r--bin/domain/imag-diary/src/main.rs6
-rw-r--r--bin/domain/imag-diary/src/view.rs7
-rw-r--r--bin/domain/imag-habit/src/main.rs122
-rw-r--r--bin/domain/imag-log/src/main.rs34
-rw-r--r--bin/domain/imag-mail/src/main.rs10
-rw-r--r--bin/domain/imag-notes/src/main.rs18
-rw-r--r--bin/domain/imag-timetrack/src/cont.rs5
-rw-r--r--bin/domain/imag-timetrack/src/day.rs5
-rw-r--r--bin/domain/imag-timetrack/src/list.rs5
-rw-r--r--bin/domain/imag-timetrack/src/main.rs2
-rw-r--r--bin/domain/imag-timetrack/src/month.rs7
-rw-r--r--bin/domain/imag-timetrack/src/start.rs2
-rw-r--r--bin/domain/imag-timetrack/src/stop.rs9
-rw-r--r--bin/domain/imag-timetrack/src/track.rs2
-rw-r--r--bin/domain/imag-timetrack/src/week.rs5
-rw-r--r--bin/domain/imag-timetrack/src/year.rs5
-rw-r--r--bin/domain/imag-todo/src/main.rs6
-rw-r--r--bin/domain/imag-wiki/src/main.rs38
-rw-r--r--lib/core/libimagerror/src/iter.rs10
-rw-r--r--lib/core/libimagerror/src/trace.rs6
53 files changed, 377 insertions, 362 deletions
diff --git a/bin/core/imag-annotate/src/main.rs b/bin/core/imag-annotate/src/main.rs
index afb5ce6e..c764758d 100644
--- a/bin/core/imag-annotate/src/main.rs
+++ b/bin/core/imag-annotate/src/main.rs
@@ -87,7 +87,7 @@ fn main() {
other => {
debug!("Unknown command");
let _ = rt.handle_unknown_subcommand("imag-annotation", other, rt.cli())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.code()
.map(::std::process::exit);
},
@@ -97,27 +97,27 @@ fn main() {
fn add(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("add").unwrap(); // safed by main()
- let mut ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1).into_iter();
+ let mut ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap().into_iter();
if let Some(first) = ids.next() {
let mut annotation = rt.store()
.get(first.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.ok_or_else(|| EM::EntryNotFound(first.local_display_string()))
.map_err(Error::from)
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.annotate(rt.store())
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
- let _ = annotation.edit_content(&rt).map_err_trace_exit_unwrap(1);
+ let _ = annotation.edit_content(&rt).map_err_trace_exit_unwrap();
for id in ids {
let mut entry = rt.store().get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.ok_or_else(|| format_err!("Not found: {}", id.local_display_string()))
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
- let _ = entry.add_internal_link(&mut annotation).map_err_trace_exit_unwrap(1);
+ let _ = entry.add_internal_link(&mut annotation).map_err_trace_exit_unwrap();
}
if !scmd.is_present("dont-print-name") {
@@ -125,7 +125,7 @@ fn add(rt: &Runtime) {
.get_header()
.read_string("annotation.name")
.map_err(Error::from)
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
{
let _ = writeln!(rt.stdout(), "Name of the annotation: {}", annotation_id)
.to_exit_code()
@@ -144,19 +144,19 @@ fn remove(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("remove").unwrap(); // safed by main()
let annotation_name = scmd.value_of("annotation_name").unwrap(); // safed by clap
let delete = scmd.is_present("delete-annotation");
- let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1);
+ let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap();
ids.into_iter().for_each(|id| {
let mut entry = rt.store()
.get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.ok_or_else(|| EM::EntryNotFound(id.local_display_string()))
.map_err(Error::from)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
let annotation = entry
.denotate(rt.store(), annotation_name)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
if delete {
debug!("Deleting annotation object");
@@ -167,7 +167,7 @@ fn remove(rt: &Runtime) {
let _ = rt
.store()
.delete(loc)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
} else {
warn!("Not having annotation object, cannot delete!");
}
@@ -181,7 +181,7 @@ fn remove(rt: &Runtime) {
fn list(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("list").unwrap(); // safed by clap
let with_text = scmd.is_present("list-with-text");
- let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1);
+ let ids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap();
if ids.len() != 0 {
let _ = ids
@@ -190,16 +190,16 @@ fn list(rt: &Runtime) {
let _ = rt
.store()
.get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.ok_or_else(|| EM::EntryNotFound(id.local_display_string()))
.map_err(Error::from)
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.annotations()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_get_iter(rt.store())
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.map(|opt| opt.ok_or_else(|| format_err!("Cannot find entry")))
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.enumerate()
.for_each(|(i, entry)| list_annotation(&rt, i, entry, with_text));
});
@@ -207,11 +207,11 @@ fn list(rt: &Runtime) {
// show them all
rt.store()
.all_annotations()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_get_iter(rt.store())
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.map(|opt| opt.ok_or_else(|| format_err!("Cannot find entry")))
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.enumerate()
.for_each(|(i, entry)| list_annotation(&rt, i, entry, with_text));
}
diff --git a/bin/core/imag-annotate/src/ui.rs b/bin/core/imag-annotate/src/ui.rs
index 024d6a3d..72074c08 100644
--- a/bin/core/imag-annotate/src/ui.rs
+++ b/bin/core/imag-annotate/src/ui.rs
@@ -110,7 +110,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
("remove", Some(subm)) => {
@@ -124,7 +124,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
("list", Some(subm)) => {
@@ -138,7 +138,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
(other, _) => {
diff --git a/bin/core/imag-category/src/main.rs b/bin/core/imag-category/src/main.rs
index 2a6e8a16..96882e41 100644
--- a/bin/core/imag-category/src/main.rs
+++ b/bin/core/imag-category/src/main.rs
@@ -81,7 +81,7 @@ fn main() {
other => {
debug!("Unknown command");
let _ = rt.handle_unknown_subcommand("imag-category", other, rt.cli())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.code()
.map(::std::process::exit);
},
@@ -92,11 +92,11 @@ fn main() {
fn set(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("set").unwrap(); // safed by main()
let name = scmd.value_of("set-name").map(String::from).unwrap(); // safed by clap
- let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1);
+ let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap();
StoreIdIterator::new(Box::new(sids.into_iter().map(Ok)))
.into_get_iter(rt.store())
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.map(|o| o.unwrap_or_else(|| {
error!("Did not find one entry");
::std::process::exit(1)
@@ -104,23 +104,23 @@ fn set(rt: &Runtime) {
.for_each(|mut entry| {
let _ = entry
.set_category_checked(rt.store(), &name)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
})
}
fn get(rt: &Runtime) {
- let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1);
+ let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap();
let out = rt.stdout();
let mut outlock = out.lock();
StoreIdIterator::new(Box::new(sids.into_iter().map(Ok)))
.into_get_iter(rt.store())
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.map(|o| o.unwrap_or_else(|| {
error!("Did not find one entry");
::std::process::exit(1)
}))
- .map(|entry| entry.get_category().map_err_trace_exit_unwrap(1))
+ .map(|entry| entry.get_category().map_err_trace_exit_unwrap())
.for_each(|name| {
let _ = writeln!(outlock, "{}", name).to_exit_code().unwrap_or_exit();
})
@@ -130,15 +130,15 @@ fn list_category(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("list-category").unwrap(); // safed by main()
let name = scmd.value_of("list-category-name").map(String::from).unwrap(); // safed by clap
- if let Some(category) = rt.store().get_category_by_name(&name).map_err_trace_exit_unwrap(1) {
+ if let Some(category) = rt.store().get_category_by_name(&name).map_err_trace_exit_unwrap() {
let out = rt.stdout();
let mut outlock = out.lock();
category
.get_entries(rt.store())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.for_each(|entry| {
- writeln!(outlock, "{}", entry.map_err_trace_exit_unwrap(1).get_location())
+ writeln!(outlock, "{}", entry.map_err_trace_exit_unwrap().get_location())
.to_exit_code()
.unwrap_or_exit();
})
@@ -155,7 +155,7 @@ fn create_category(rt: &Runtime) {
let _ = rt
.store()
.create_category(&name)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
}
fn delete_category(rt: &Runtime) {
@@ -170,14 +170,14 @@ fn delete_category(rt: &Runtime) {
::std::process::exit(1)
});
let mut output = rt.stdout();
- let answer = ask_bool(&ques, Some(false), &mut input, &mut output).map_err_trace_exit_unwrap(1);
+ let answer = ask_bool(&ques, Some(false), &mut input, &mut output).map_err_trace_exit_unwrap();
if answer {
info!("Deleting category '{}'", name);
let _ = rt
.store()
.delete_category(&name)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
} else {
info!("Not doing anything");
}
@@ -189,9 +189,9 @@ fn list_categories(rt: &Runtime) {
rt.store()
.all_category_names()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.for_each(|name| {
- writeln!(outlock, "{}", name.map_err_trace_exit_unwrap(1))
+ writeln!(outlock, "{}", name.map_err_trace_exit_unwrap())
.to_exit_code()
.unwrap_or_exit();
})
diff --git a/bin/core/imag-category/src/ui.rs b/bin/core/imag-category/src/ui.rs
index a9b50bfd..fca41bd0 100644
--- a/bin/core/imag-category/src/ui.rs
+++ b/bin/core/imag-category/src/ui.rs
@@ -136,7 +136,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
("get", Some(subm)) => {
@@ -150,7 +150,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
(other, _) => {
diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs
index 47b48b71..257af6a5 100644
--- a/bin/core/imag-diagnostics/src/main.rs
+++ b/bin/core/imag-diagnostics/src/main.rs
@@ -143,12 +143,12 @@ fn main() {
let diags = rt.store()
.entries()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_get_iter()
.map(|e| {
- e.map_err_trace_exit_unwrap(1)
+ e.map_err_trace_exit_unwrap()
.ok_or_else(|| Error::from(err_msg("Unable to get entry".to_owned())))
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
})
.map(|e| {
let diag = Diagnostic::for_entry(&e);
@@ -162,14 +162,14 @@ fn main() {
// The store has an API for it, but the cache size calculation is O(n) and we can do
// better by simply flushing the cache each 100 entries
if entries_counter > 100 {
- let _ = rt.store().flush_cache().map_err_trace_exit_unwrap(1);
+ let _ = rt.store().flush_cache().map_err_trace_exit_unwrap();
entries_counter = 0;
}
diag
})
.collect::<Result<Vec<_>>>()
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
spinner.finish();
let n = diags.len();
@@ -244,7 +244,7 @@ fn main() {
num,
path
.into_pathbuf()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.to_str()
.unwrap_or("Failed converting path to string")
);
@@ -257,7 +257,7 @@ fn main() {
num,
path
.into_pathbuf()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.to_str()
.unwrap_or("Failed converting path to string")
);
@@ -271,7 +271,7 @@ fn get_config(rt: &Runtime, s: &'static str) -> Option<String> {
rt.config().and_then(|cfg| {
cfg.read(s)
.map_err(Error::from)
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.map(|opt| match opt {
&Value::String(ref s) => s.to_owned(),
_ => {
diff --git a/bin/core/imag-edit/src/main.rs b/bin/core/imag-edit/src/main.rs
index 9eb53cfe..c0a97dd5 100644
--- a/bin/core/imag-edit/src/main.rs
+++ b/bin/core/imag-edit/src/main.rs
@@ -63,11 +63,11 @@ fn main() {
let edit_header = rt.cli().is_present("edit-header");
let edit_header_only = rt.cli().is_present("edit-header-only");
- let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap(1);
+ let sids = rt.ids::<::ui::PathProvider>().map_err_trace_exit_unwrap();
StoreIdIterator::new(Box::new(sids.into_iter().map(Ok)))
.into_get_iter(rt.store())
- .trace_unwrap_exit(1)
+ .trace_unwrap_exit()
.map(|o| o.unwrap_or_else(|| {
error!("Did not find one entry");
::std::process::exit(1)
@@ -76,15 +76,15 @@ fn main() {
if edit_header {
let _ = entry
.edit_header_and_content(&rt)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
} else if edit_header_only {
let _ = entry
.edit_header(&rt)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
} else {
let _ = entry
.edit_content(&rt)
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
}
});
}
diff --git a/bin/core/imag-edit/src/ui.rs b/bin/core/imag-edit/src/ui.rs
index 2b95a84f..3b788251 100644
--- a/bin/core/imag-edit/src/ui.rs
+++ b/bin/core/imag-edit/src/ui.rs
@@ -66,6 +66,6 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
}
}
diff --git a/bin/core/imag-gps/src/main.rs b/bin/core/imag-gps/src/main.rs
index ac673062..6ca785d4 100644
--- a/bin/core/imag-gps/src/main.rs
+++ b/bin/core/imag-gps/src/main.rs
@@ -79,7 +79,7 @@ fn main() {
other => {
debug!("Unknown command");
let _ = rt.handle_unknown_subcommand("imag-gps", other, rt.cli())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.code()
.map(::std::process::exit);
}
@@ -96,7 +96,7 @@ fn add(rt: &Runtime) {
.map(FromStr::from_str)
.map(|elem| {
elem.or_else(|_| Err(Error::from(err_msg("Error while converting number"))))
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
})
.collect::<Vec<i64>>();
@@ -125,18 +125,18 @@ fn add(rt: &Runtime) {
};
rt.ids::<::ui::PathProvider>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_iter()
.for_each(|id| {
rt.store()
.get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.unwrap_or_else(|| { // if we have Ok(None)
error!("No such entry: {}", id);
exit(1)
})
.set_coordinates(c.clone())
- .map_err_trace_exit_unwrap(1);
+ .map_err_trace_exit_unwrap();
let _ = rt.report_touched(&id).unwrap_or_exit();
});
@@ -150,24 +150,24 @@ fn remove(rt: &Runtime) {
.is_present("print-removed"); // safed by main()
rt.ids::<::ui::PathProvider>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_iter()
.for_each(|id| {
let removed_value = rt
.store()
.get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.unwrap_or_else(|| { // if we have Ok(None)
error!("No such entry: {}", id);
exit(1)
})
.remove_coordinates()
- .map_err_trace_exit_unwrap(1) // The delete action failed
+ .map_err_trace_exit_unwrap() // The delete action failed
.unwrap_or_else(|| { // if we have Ok(None)
error!("Entry had no coordinates: {}", id);
exit(1)
})
- .map_err_trace_exit_unwrap(1); // The parsing of the deleted values failed
+ .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();
@@ -180,19 +180,19 @@ fn remove(rt: &Runtime) {
fn get(rt: &Runtime) {
let mut stdout = rt.stdout();
rt.ids::<::ui::PathProvider>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.into_iter()
.for_each(|id| {
let value = rt
.store()
.get(id.clone())
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
.unwrap_or_else(|| { // if we have Ok(None)
error!("No such entry: {}", id);
exit(1)
})
.get_coordinates()
- .map_err_trace_exit_unwrap(1) // The get action failed
+ .map_err_trace_exit_unwrap() // The get action failed
.unwrap_or_else(|| { // if we have Ok(None)
error!("Entry has no coordinates: {}", id);
exit(1)
diff --git a/bin/core/imag-gps/src/ui.rs b/bin/core/imag-gps/src/ui.rs
index 878daf67..572e1c48 100644
--- a/bin/core/imag-gps/src/ui.rs
+++ b/bin/core/imag-gps/src/ui.rs
@@ -112,7 +112,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
("remove", Some(subm)) => {
@@ -126,7 +126,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
("get", Some(subm)) => {
@@ -140,7 +140,7 @@ impl IdPathProvider for PathProvider {
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>, _>>()
- .map_err_trace_exit_unwrap(1)
+ .map_err_trace_exit_unwrap()
},
(other, _) => {
diff --git a/bin/core/imag-grep/src/main.rs b/bin/core/imag-grep/src/main.rs
index 9ab3c29d..faf5c139 100644
--- a/bin/core/imag-grep/src/main.rs
+++ b/bin/core/imag-grep/src/main.rs
@@ -87,9 +87,9