summaryrefslogtreecommitdiff
path: root/src/entities/bug.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-08-11 16:59:15 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-08-11 16:59:15 +0200
commit57f412d73a151f7a4fa35feaf249808dcbe5b5dc (patch)
tree219aebf5db4b9c621a4f5bcb86b12a8033bda353 /src/entities/bug.rs
parent092eb4685e9073b046c98371ab15f85156426d15 (diff)
Clippy-suggested improvements
Diffstat (limited to 'src/entities/bug.rs')
-rw-r--r--src/entities/bug.rs7
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