From b5f4c3bb13185b4c29cd9675ae15e9c0e3c67280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Wed, 13 Jul 2022 10:32:41 +0200 Subject: [PATCH] Enumerate habits in `list` subcommand. --- src/habitmgr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/habitmgr.rs b/src/habitmgr.rs index 391bacf..56e0b79 100644 --- a/src/habitmgr.rs +++ b/src/habitmgr.rs @@ -88,9 +88,9 @@ impl HabitMgr pub fn list(&mut self, all:bool, verbose:bool) { self.import_habits(); - for i in &self.habits + for (i, habit) in self.habits.iter().enumerate() { - println!("{}", i.get_name()); + println!("{}\t{}", i, habit.get_name()); } } }