diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2018-08-11 16:59:15 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2018-08-11 16:59:15 +0200 |
commit | 57f412d73a151f7a4fa35feaf249808dcbe5b5dc (patch) | |
tree | 219aebf5db4b9c621a4f5bcb86b12a8033bda353 /src/entities/bug.rs | |
parent | 092eb4685e9073b046c98371ab15f85156426d15 (diff) |
Clippy-suggested improvements
Diffstat (limited to 'src/entities/bug.rs')
-rw-r--r-- | src/entities/bug.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/entities/bug.rs b/src/entities/bug.rs index f64669d..b5e31c7 100644 --- a/src/entities/bug.rs +++ b/src/entities/bug.rs @@ -13,13 +13,10 @@ const SPEED: f64 = 175.; impl Bug { pub fn new(x: f64, y: f64) -> Bug { - let pos = Vec2d { - x: x, - y: y - }; + let pos = Vec2d::new(x, y); let pos_unit = pos.unit(); Bug { - pos: pos, + pos, rotation: (-pos).angle(), velocity: -pos_unit * SPEED, alive: true |