diff options
author | tom barrett <spalf0@gmail.com> | 2018-06-28 04:00:48 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-06-28 04:00:48 -0500 |
commit | 828f0d83dcb258a8e5efd55a7775592c6e5f77bc (patch) | |
tree | d99dfba7357a5e2cbf8162fe037f2f0fd5a87482 /src/modules/construction.rs | |
parent | ae79327d4f0ee6de0ef6b8e3c51299aebfe3bc25 (diff) |
-moved over it if let from bad matches
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() } } |