From 828f0d83dcb258a8e5efd55a7775592c6e5f77bc Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 28 Jun 2018 04:00:48 -0500 Subject: -moved over it if let from bad matches --- src/modules/construction.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/modules/construction.rs') 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() } } -- cgit v1.2.3