aboutsummaryrefslogtreecommitdiff
path: root/src/app/impl_self.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-22 16:30:38 +0100
committerAkshay <[email protected]>2020-07-22 16:30:38 +0100
commit3f64deb152c31f2a04612d9c525537a72605d678 (patch)
treeddab742cce4422f8f3da43d4ebd0535b1d7814f1 /src/app/impl_self.rs
parent9102dc72be19f87ec9e2893a35f5020957135c1c (diff)
remove `d` keybind, add tab completion
Diffstat (limited to 'src/app/impl_self.rs')
-rw-r--r--src/app/impl_self.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs
index 95f1871..7eae853 100644
--- a/src/app/impl_self.rs
+++ b/src/app/impl_self.rs
@@ -37,6 +37,10 @@ impl App {
37 self.habits.push(h); 37 self.habits.push(h);
38 } 38 }
39 39
40 pub fn list_habits(&self) -> Vec<String> {
41 self.habits.iter().map(|x| x.name()).collect::<Vec<_>>()
42 }
43
40 pub fn delete_by_name(&mut self, name: &str) { 44 pub fn delete_by_name(&mut self, name: &str) {
41 let old_len = self.habits.len(); 45 let old_len = self.habits.len();
42 self.habits.retain(|h| h.name() != name); 46 self.habits.retain(|h| h.name() != name);