diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-02-10 00:21:01 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-02-10 01:00:38 +0100 |
commit | 53022443abf4970bea452a87aa90cb66893f1e63 (patch) | |
tree | 08f0f7ad2b9c67d888659aa60dfb1ca6ab47d3f1 /bin/core | |
parent | d8cd10a384e3cb8674214b68a83c690d927b48ee (diff) |
Rewrite iteration
This patch rewrites how imag-annotate iterates over the ids to process
to be more easily to understand.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/core')
-rw-r--r-- | bin/core/imag-annotate/src/main.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/core/imag-annotate/src/main.rs b/bin/core/imag-annotate/src/main.rs index ae4dea6b..afb5ce6e 100644 --- a/bin/core/imag-annotate/src/main.rs +++ b/bin/core/imag-annotate/src/main.rs @@ -205,15 +205,15 @@ fn list(rt: &Runtime) { }); } else { // ids.len() == 0 // show them all - let _ = rt - .store() + rt.store() .all_annotations() .map_err_trace_exit_unwrap(1) + .into_get_iter(rt.store()) + .trace_unwrap_exit(1) + .map(|opt| opt.ok_or_else(|| format_err!("Cannot find entry"))) + .trace_unwrap_exit(1) .enumerate() - .map(|(i, a)| { - list_annotation(&rt, i, a.map_err_trace_exit_unwrap(1), with_text) - }) - .collect::<Vec<_>>(); + .for_each(|(i, entry)| list_annotation(&rt, i, entry, with_text)); } } |