diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-02-10 22:46:59 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-02-11 03:52:04 +0100 |
commit | 86dca4887d0e7a9540c951e06aed112eb1593786 (patch) | |
tree | d6fbc2043ebbcb076654731288cbc34a4a1c3a7a /bin/domain/imag-habit/src | |
parent | 334e9e39549e84dd9a42c040a318bfc41ac84cba (diff) |
Fix negation error
We Iterator::filter here, so we have to negate - because we list
everything where _no_ instance exists yet.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/domain/imag-habit/src')
-rw-r--r-- | bin/domain/imag-habit/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/domain/imag-habit/src/main.rs b/bin/domain/imag-habit/src/main.rs index d667ff6a..10b6c556 100644 --- a/bin/domain/imag-habit/src/main.rs +++ b/bin/domain/imag-habit/src/main.rs @@ -365,7 +365,7 @@ fn today(rt: &Runtime, future: bool) { relevant .into_iter() .filter(|habit| show_done || { - habit + let instance_exists = habit .next_instance_date() .map_err_trace_exit_unwrap() .map(|date| { @@ -380,7 +380,9 @@ fn today(rt: &Runtime, future: bool) { instance_exists }) - .unwrap_or(false) + .unwrap_or(false); + + !instance_exists }) .enumerate() .for_each(|(i, e)| { |