diff options
Diffstat (limited to 'src/modules/construction.rs')
-rw-r--r-- | src/modules/construction.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/modules/construction.rs b/src/modules/construction.rs index 22086a5..46ddbb1 100644 --- a/src/modules/construction.rs +++ b/src/modules/construction.rs @@ -27,14 +27,11 @@ impl Construction { } pub fn process(&mut self) { - match self.start.clone() { - Some(timer) => { - if timer.elapsed().unwrap().as_secs() > self.time { - self.start = Some(SystemTime::now()); - self.status = ConstructionStatus::Constructed; - } + if let Some(timer) = self.start.clone() { + if timer.elapsed().unwrap().as_secs() > self.time { + self.start = Some(SystemTime::now()); + self.status = ConstructionStatus::Constructed; } - _ => (), } } @@ -56,6 +53,6 @@ impl Construction { } pub fn take(&mut self) { - self.status = ConstructionStatus::None; + self.off() } } |