diff options
Diffstat (limited to 'src/app/update.rs')
-rw-r--r-- | src/app/update.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/app/update.rs b/src/app/update.rs index baf4651..4e21050 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -48,15 +48,13 @@ pub async fn event_handler(rx: Receiver<Msg>, mut app: App) { None => println!("Event not found when updating from {:?} to {:?}", old, new), } } - Msg::DeleteEvent { event } => { - match app.events.iter().position(|e| e.id == event.id) { - Some(index) => { - app.events.remove(index); - calendar::refresh_date(&app, event.date); - } - None => println!("Event not found when trying to delete {:?}", event), + Msg::DeleteEvent { event } => match app.events.iter().position(|e| e.id == event.id) { + Some(index) => { + app.events.remove(index); + calendar::refresh_date(&app, event.date); } - } + None => println!("Event not found when trying to delete {:?}", event), + }, } } } |