Remove unwrap when getting active schedule
This commit is contained in:
parent
41cc9e0622
commit
2f5bb538b2
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue