diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
commit | fd52e266c6e25999a49c36f17342977b759a2612 (patch) | |
tree | 9c727cac949c9698343d003ee87cfe73c6c6204a /planetwars-rules/src/rules.rs | |
parent | f7655005ff099e8314ecd31e95b26ad74d4efd02 (diff) | |
download | planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.tar.xz planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.zip |
apply clippy suggestions
Diffstat (limited to 'planetwars-rules/src/rules.rs')
-rw-r--r-- | planetwars-rules/src/rules.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<usize> { @@ -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 } } |