diff options
author | tom barrett <spalf0@gmail.com> | 2019-03-02 11:01:02 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-03-02 11:01:02 -0600 |
commit | 0973ac1666a6ee3b606a537742abe506719fd156 (patch) | |
tree | 2611d628601e9bf69f8ab478bb209791c58a4a10 /src | |
parent | ce9adc4cc1b4b30322dc30ee85c42ee1451ffbf9 (diff) |
engines tests
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/engines.rs | 13 |
1 files changed, 6 insertions, 7 deletions
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 => (), } } |