From 0973ac1666a6ee3b606a537742abe506719fd156 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Sat, 2 Mar 2019 11:01:02 -0600 Subject: engines tests --- src/modules/engines.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/modules/engines.rs b/src/modules/engines.rs index ebf4e8b..9aa8297 100644 --- a/src/modules/engines.rs +++ b/src/modules/engines.rs @@ -40,14 +40,13 @@ impl Engines { self.status = Status::None; } } - match self.target_velocity.clone() { - Some(target_velocity) => { - self.acceleration += target_velocity - velocity; - if self.acceleration == Vector::default() { - self.target_velocity = None; - } + + if let Some(target_velocity) = self.target_velocity.clone() { + self.acceleration += target_velocity - velocity; + if self.acceleration == Vector::default() { + self.target_velocity = None; + self.status = Status::None; } - None => (), } } -- cgit v1.2.3