diff options
author | Akshay <[email protected]> | 2020-07-23 17:53:59 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-07-23 17:53:59 +0100 |
commit | 91cb3ebf5b3af666b13f4821ff25f219fdccd7b9 (patch) | |
tree | c91d6cffd4d215b325e81bedfdcfdfdcea76a537 /src/habit/count.rs | |
parent | 02bba52346d948e90fbc1b351486f0f1307c243d (diff) | |
parent | d1d1aeb3d5aaa75f262467c5e683e76ce7a844ab (diff) |
Merge branch 'feature/windows' of https://github.com/filalex77/dijo into feature/windows
Diffstat (limited to 'src/habit/count.rs')
-rw-r--r-- | src/habit/count.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/habit/count.rs b/src/habit/count.rs index 1bdf920..d351758 100644 --- a/src/habit/count.rs +++ b/src/habit/count.rs | |||
@@ -84,12 +84,15 @@ impl Habit for Count { | |||
84 | if *val > 0 { | 84 | if *val > 0 { |
85 | *val -= 1 | 85 | *val -= 1 |
86 | } else { | 86 | } else { |
87 | *val = 0 | 87 | self.stats.remove(&date); |
88 | }; | 88 | }; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | } else { | 91 | } else { |
92 | self.insert_entry(date, 1); | 92 | match event { |
93 | TrackEvent::Increment => self.insert_entry(date, 1), | ||
94 | _ => {} | ||
95 | }; | ||
93 | } | 96 | } |
94 | } | 97 | } |
95 | fn set_view_month_offset(&mut self, offset: u32) { | 98 | fn set_view_month_offset(&mut self, offset: u32) { |