diff --git a/src/habitmgr.rs b/src/habitmgr.rs index 56e0b79..e0266ea 100644 --- a/src/habitmgr.rs +++ b/src/habitmgr.rs @@ -77,12 +77,14 @@ impl HabitMgr panic!("Error opening file {}:\n{}", self.habits_path.display(), e); }); - let habit = Habit::new(name, bad, weight); + let habit = Habit::new(name.clone(), bad, weight); serde_json::to_writer(habits_file, &habit) .unwrap_or_else(|e| { panic!("Error writing to file {}:\n{}", self.habits_path.display(), e); - }) + }); + + println!("New habit {} added.", &name); } pub fn list(&mut self, all:bool, verbose:bool)