From fd52e266c6e25999a49c36f17342977b759a2612 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 13 Mar 2022 15:20:03 +0100 Subject: apply clippy suggestions --- planetwars-rules/src/rules.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'planetwars-rules/src/rules.rs') diff --git a/planetwars-rules/src/rules.rs b/planetwars-rules/src/rules.rs index 587098f..e339b4e 100644 --- a/planetwars-rules/src/rules.rs +++ b/planetwars-rules/src/rules.rs @@ -128,7 +128,7 @@ impl PwState { pub fn is_finished(&self) -> bool { let remaining = self.players.iter().filter(|p| p.alive).count(); - return remaining < 2 || self.turn_num >= self.max_turns; + remaining < 2 || self.turn_num >= self.max_turns } pub fn living_players(&self) -> Vec { @@ -187,6 +187,6 @@ impl Planet { fn distance(&self, other: &Planet) -> u64 { let dx = self.x - other.x; let dy = self.y - other.y; - return (dx.powi(2) + dy.powi(2)).sqrt().ceil() as u64; + (dx.powi(2) + dy.powi(2)).sqrt().ceil() as u64 } } -- cgit v1.2.3