mirror of
https://github.com/MalteT/mensa.git
synced 2024-10-22 21:59:17 +02:00
Handle empty meal lists
This commit is contained in:
parent
7ac8bbfe80
commit
bb006be35d
|
@ -94,10 +94,10 @@ impl Meal {
|
|||
// The day for which to print meals
|
||||
let day = CONF.date();
|
||||
for canteen in canteens {
|
||||
let name = canteen.name()?.clone();
|
||||
let name = canteen.name()?;
|
||||
println!("\n {}", color!(name; bright_black));
|
||||
match canteen.meals_at_mut(day)? {
|
||||
Some(meals) => {
|
||||
println!("\n {}", color!(name; bright_black));
|
||||
for meal in meals {
|
||||
let complete = meal.complete()?;
|
||||
if filter.is_match(&complete) {
|
||||
|
@ -107,7 +107,9 @@ impl Meal {
|
|||
}
|
||||
}
|
||||
}
|
||||
None => todo!(),
|
||||
None => {
|
||||
println!("{} {}", *PRE, color!("no meals listed"; dimmed))
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue