task: remove a copy operation

This commit is contained in:
Victoria Fischer 2024-12-14 14:46:16 +01:00
parent d09c82c3fc
commit da2a8f5bfc

View File

@ -42,18 +42,18 @@ impl ScheduledTask {
}
fn start(&mut self) {
self.state = match self.state {
ScheduledState::Stopped => ScheduledState::Start,
ScheduledState::Stop => ScheduledState::Running,
_ => self.state
match self.state {
ScheduledState::Stopped => self.state = ScheduledState::Start,
ScheduledState::Stop => self.state = ScheduledState::Running,
_ => ()
}
}
fn stop(&mut self) {
self.state = match self.state {
ScheduledState::Running => ScheduledState::Stop,
ScheduledState::Start => ScheduledState::Stopped,
_ => self.state
match self.state {
ScheduledState::Running => self.state = ScheduledState::Stop,
ScheduledState::Start => self.state = ScheduledState::Stopped,
_ => ()
}
}