summaryrefslogtreecommitdiffstats
path: root/bin/domain/imag-calendar/src/util.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-11-10 02:11:25 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-12-22 02:03:35 +0100
commit8208a683f1538049b2e15ad9fd81cf511df9ab9e (patch)
treedc9996bbca53723d2cbd162ff7d811b0de9ee37a /bin/domain/imag-calendar/src/util.rs
parentecaa1585b994221bb4a6db749eb73384af6ff12b (diff)
Rewrite for less cluttered code
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/domain/imag-calendar/src/util.rs')
-rw-r--r--bin/domain/imag-calendar/src/util.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/domain/imag-calendar/src/util.rs b/bin/domain/imag-calendar/src/util.rs
index 469c2e92..f6a45460 100644
--- a/bin/domain/imag-calendar/src/util.rs
+++ b/bin/domain/imag-calendar/src/util.rs
@@ -132,14 +132,11 @@ pub fn kairos_parse(spec: &str) -> Result<NaiveDateTime> {
::kairos::parser::Parsed::TimeType(tt) => {
trace!("before-filter spec resulted in timetype");
- let tt = tt.calculate()
+ tt.calculate()
.map_err_trace_exit_unwrap()
.get_moment()
- .ok_or_else(|| format_err!("Not a moment in time: {}", spec))?
- .clone();
-
- trace!("Before filter spec {} => {}", spec, tt);
- Ok(tt)
+ .cloned()
+ .ok_or_else(|| format_err!("Not a moment in time: {}", spec))
}
}
}