From 57f412d73a151f7a4fa35feaf249808dcbe5b5dc Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 11 Aug 2018 16:59:15 +0200 Subject: Clippy-suggested improvements --- src/entities/bug.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/entities/bug.rs') 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 -- cgit v1.2.3