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) {
|
fn start(&mut self) {
|
||||||
self.state = match self.state {
|
match self.state {
|
||||||
ScheduledState::Stopped => ScheduledState::Start,
|
ScheduledState::Stopped => self.state = ScheduledState::Start,
|
||||||
ScheduledState::Stop => ScheduledState::Running,
|
ScheduledState::Stop => self.state = ScheduledState::Running,
|
||||||
_ => self.state
|
_ => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stop(&mut self) {
|
fn stop(&mut self) {
|
||||||
self.state = match self.state {
|
match self.state {
|
||||||
ScheduledState::Running => ScheduledState::Stop,
|
ScheduledState::Running => self.state = ScheduledState::Stop,
|
||||||
ScheduledState::Start => ScheduledState::Stopped,
|
ScheduledState::Start => self.state = ScheduledState::Stopped,
|
||||||
_ => self.state
|
_ => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user