diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-11-04 22:28:47 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-11-06 14:48:49 +0100 |
commit | 1321f49428b1d77611c5722733e5abd646026948 (patch) | |
tree | d7cc632852ff54661c35ce75fdc6c0b8f0e0f3af /bin/domain/imag-diary | |
parent | d004c667fd7ba901e156f7943d068fb8c785f81e (diff) |
Optimize implementation
Code-wise, the functionality was not changed. The changes only make the
code much more pretty.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/domain/imag-diary')
-rw-r--r-- | bin/domain/imag-diary/src/list.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/domain/imag-diary/src/list.rs b/bin/domain/imag-diary/src/list.rs index a1f32ff2..e5a2b3ff 100644 --- a/bin/domain/imag-diary/src/list.rs +++ b/bin/domain/imag-diary/src/list.rs @@ -51,10 +51,9 @@ pub fn list(rt: &Runtime) { [id.year() as u32, id.month(), id.day(), id.hour(), id.minute(), id.second()] }); - for id in ids.into_iter().map(|id| id.into_storeid().map_err_trace_exit_unwrap(1)) { - writeln!(rt.stdout(), "{}", id) - .to_exit_code() - .unwrap_or_exit(); - } + ids.into_iter() + .map(IntoStoreId::into_storeid) + .trace_unwrap_exit(1) + .for_each(|id| writeln!(rt.stdout(), "{}", id).to_exit_code().unwrap_or_exit()); } |