Skip to content

Commit

Permalink
feat: Display specific message when no birthday is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ducdetronquito committed Jan 1, 2024
1 parent 6b9e42a commit 8d7876c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ impl DisplayedBirthday {
}

pub fn output(birthdays: Vec<Birthday>, today: NaiveDate) {
if birthdays.is_empty() {
println!("No birthday found 🔎");
return;
}
let mut displayed_birthdays: Vec<DisplayedBirthday> = birthdays
.iter()
.map(|birthday| DisplayedBirthday::from_birthday(birthday, today))
Expand Down

0 comments on commit 8d7876c

Please sign in to comment.