From 1321f49428b1d77611c5722733e5abd646026948 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 4 Nov 2018 22:28:47 +0100 Subject: [PATCH] Optimize implementation Code-wise, the functionality was not changed. The changes only make the code much more pretty. Signed-off-by: Matthias Beyer --- bin/domain/imag-diary/src/list.rs | 9 ++++----- 1 file 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()); }