mirror of
https://github.com/MalteT/mensa.git
synced 2024-10-22 21:59:17 +02:00
Add additional printing info
Make sure when printing meals, there's a note about canteens without matching meals and canteens closed on that particular day.
This commit is contained in:
parent
070208fb20
commit
b763d10616
|
@ -99,17 +99,22 @@ impl Meal {
|
|||
println!("\n {}", color!(name; bright_black));
|
||||
match canteen.meals_at_mut(day)? {
|
||||
Some(meals) => {
|
||||
let mut printed_at_least_one_meal = false;
|
||||
for meal in meals {
|
||||
let complete = meal.complete()?;
|
||||
if filter.is_match(&complete) {
|
||||
let is_fav = favs.is_match(&complete);
|
||||
println!("{}", *PRE);
|
||||
complete.print(is_fav);
|
||||
printed_at_least_one_meal = true;
|
||||
}
|
||||
}
|
||||
if !printed_at_least_one_meal {
|
||||
println!("{} {}", *PRE, color!("no matching meals found"; dimmed));
|
||||
}
|
||||
}
|
||||
None => {
|
||||
println!("{} {}", *PRE, color!("no meals listed"; dimmed))
|
||||
println!("{} {}", *PRE, color!("closed"; dimmed))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue