diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-10-12 19:08:36 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-10-12 20:15:46 +0200 |
commit | 815cde76d007457576bce7d2c64e0f5be4c244c1 (patch) | |
tree | fda72d7d11d381c40b0ac4682b6692f3b4fe232e /bin/domain/imag-notes | |
parent | eb4681bf653fb0f1b64713c0ecc8cfbf98d5d601 (diff) |
Rewrite .map_err_trace_exit().unwrap() with new helper fn
Diffstat (limited to 'bin/domain/imag-notes')
-rw-r--r-- | bin/domain/imag-notes/src/main.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/domain/imag-notes/src/main.rs b/bin/domain/imag-notes/src/main.rs index 86dfe962..8f22596b 100644 --- a/bin/domain/imag-notes/src/main.rs +++ b/bin/domain/imag-notes/src/main.rs @@ -74,8 +74,7 @@ fn create(rt: &Runtime) { let mut note = rt .store() .new_note(name.clone(), String::new()) - .map_err_trace_exit(1) - .unwrap(); + .map_err_trace_exit_unwrap(1); if rt.cli().subcommand_matches("create").unwrap().is_present("edit") { let _ = note @@ -97,8 +96,7 @@ fn edit(rt: &Runtime) { let _ = rt .store() .get_note(name.clone()) - .map_err_trace_exit(1) - .unwrap() + .map_err_trace_exit_unwrap(1) .map(|mut note| { let _ = note .edit_content(rt) @@ -118,7 +116,7 @@ fn list(rt: &Runtime) { .map_err_trace_exit(1) .map(|iter| { let notes = iter - .filter_map(|noteid| rt.store().get(noteid).map_err_trace_exit(1).unwrap()) + .filter_map(|noteid| rt.store().get(noteid).map_err_trace_exit_unwrap(1)) .sorted_by(|note_a, note_b| { if let (Ok(a), Ok(b)) = (note_a.get_name(), note_b.get_name()) { return a.cmp(&b) |