task: remove a copy operation
This commit is contained in:
parent
d09c82c3fc
commit
da2a8f5bfc
16
src/task.rs
16
src/task.rs
@ -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,
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user