Remove unwrap when getting active schedule

This commit is contained in:
Tobias Reisinger 2024-10-28 02:17:38 +01:00
parent 41cc9e0622
commit 2f5bb538b2
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

@ -113,7 +113,9 @@ impl Relay {
}
}
self.active_schedule = Some(self.schedules.get(weekday as usize).unwrap().clone())
if let Some(schedule) = self.schedules.get(weekday as usize) {
self.active_schedule = Some(schedule.clone());
}
}
pub fn apply_state(&mut self, state: &RelayState) {