From ea31715edf4418c93a30c380c892ebb003fdd23f Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Fri, 15 May 2020 20:14:47 -0300 Subject: [PATCH] Simplified match --- src/eventlist/event.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/eventlist/event.rs b/src/eventlist/event.rs index 254cfb1..3ce55d2 100644 --- a/src/eventlist/event.rs +++ b/src/eventlist/event.rs @@ -131,10 +131,12 @@ impl Event { EventDateType::AllDay(_) if eta.num_minutes() > 0 => { Some(format!("{}d", eta.num_days())) } - EventDateType::AtTime(_, _) if eta.num_minutes() > 0 => match eta.num_days() { - 0 => Some(format!("{}h", eta.num_hours())), - _ => Some(format!("{}d {}h", eta.num_days(), eta.num_hours())), - }, + EventDateType::AtTime(_, _) if eta.num_days() > 0 => { + Some(format!("{}d {}h", eta.num_days(), eta.num_hours())) + } + EventDateType::AtTime(_, _) if eta.num_hours() > 0 => { + Some(format!("{}h", eta.num_hours())) + } _ => None, } }