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>
This commit is contained in:
parent
d8cd10a384
commit
53022443ab
1 changed files with 6 additions and 6 deletions
|
@ -205,15 +205,15 @@ fn list(rt: &Runtime) {
|
||||||
});
|
});
|
||||||
} else { // ids.len() == 0
|
} else { // ids.len() == 0
|
||||||
// show them all
|
// show them all
|
||||||
let _ = rt
|
rt.store()
|
||||||
.store()
|
|
||||||
.all_annotations()
|
.all_annotations()
|
||||||
.map_err_trace_exit_unwrap(1)
|
.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()
|
.enumerate()
|
||||||
.map(|(i, a)| {
|
.for_each(|(i, entry)| list_annotation(&rt, i, entry, with_text));
|
||||||
list_annotation(&rt, i, a.map_err_trace_exit_unwrap(1), with_text)
|
|
||||||
})
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue