aboutsummaryrefslogtreecommitdiff
path: root/src/habit.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-12 08:06:46 +0100
committerAkshay <[email protected]>2020-07-12 08:06:46 +0100
commitec875633e34614cfa656c4e0dbb35cddcca38d14 (patch)
tree340ae0e36db345ead0d651d40cb61d9679305232 /src/habit.rs
parente670dab4826006dda1bccdd05d99a61b4fe2b900 (diff)
rename `Habit::total` to `Habit::goal`
Diffstat (limited to 'src/habit.rs')
-rw-r--r--src/habit.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/habit.rs b/src/habit.rs
index 5469aab..cb6f03d 100644
--- a/src/habit.rs
+++ b/src/habit.rs
@@ -62,7 +62,7 @@ pub trait Habit {
62 fn insert_entry(&mut self, date: NaiveDate, val: Self::HabitType); 62 fn insert_entry(&mut self, date: NaiveDate, val: Self::HabitType);
63 fn reached_goal(&self, date: NaiveDate) -> bool; 63 fn reached_goal(&self, date: NaiveDate) -> bool;
64 fn remaining(&self, date: NaiveDate) -> u32; 64 fn remaining(&self, date: NaiveDate) -> u32;
65 fn total(&self) -> u32; 65 fn goal(&self) -> u32;
66 fn modify(&mut self, date: NaiveDate, event: TrackEvent); 66 fn modify(&mut self, date: NaiveDate, event: TrackEvent);
67 67
68 fn set_view_month_offset(&mut self, offset: u32); 68 fn set_view_month_offset(&mut self, offset: u32);
@@ -75,7 +75,7 @@ pub trait Habit {
75#[typetag::serde(tag = "type")] 75#[typetag::serde(tag = "type")]
76pub trait HabitWrapper: erased_serde::Serialize { 76pub trait HabitWrapper: erased_serde::Serialize {
77 fn remaining(&self, date: NaiveDate) -> u32; 77 fn remaining(&self, date: NaiveDate) -> u32;
78 fn total(&self) -> u32; 78 fn goal(&self) -> u32;
79 fn modify(&mut self, date: NaiveDate, event: TrackEvent); 79 fn modify(&mut self, date: NaiveDate, event: TrackEvent);
80 fn draw(&self, printer: &Printer); 80 fn draw(&self, printer: &Printer);
81 fn on_event(&mut self, event: Event) -> EventResult; 81 fn on_event(&mut self, event: Event) -> EventResult;
@@ -97,8 +97,8 @@ macro_rules! auto_habit_impl {
97 fn remaining(&self, date: NaiveDate) -> u32 { 97 fn remaining(&self, date: NaiveDate) -> u32 {
98 Habit::remaining(self, date) 98 Habit::remaining(self, date)
99 } 99 }
100 fn total(&self) -> u32 { 100 fn goal(&self) -> u32 {
101 Habit::total(self) 101 Habit::goal(self)
102 } 102 }
103 fn modify(&mut self, date: NaiveDate, event: TrackEvent) { 103 fn modify(&mut self, date: NaiveDate, event: TrackEvent) {
104 Habit::modify(self, date, event); 104 Habit::modify(self, date, event);
@@ -199,7 +199,7 @@ impl Habit for Count {
199 } 199 }
200 } 200 }
201 } 201 }
202 fn total(&self) -> u32 { 202 fn goal(&self) -> u32 {
203 return self.goal; 203 return self.goal;
204 } 204 }
205 fn modify(&mut self, date: NaiveDate, event: TrackEvent) { 205 fn modify(&mut self, date: NaiveDate, event: TrackEvent) {
@@ -293,7 +293,7 @@ impl Habit for Bit {
293 return 1; 293 return 1;
294 } 294 }
295 } 295 }
296 fn total(&self) -> u32 { 296 fn goal(&self) -> u32 {
297 return 1; 297 return 1;
298 } 298 }
299 fn modify(&mut self, date: NaiveDate, _: TrackEvent) { 299 fn modify(&mut self, date: NaiveDate, _: TrackEvent) {