From 4f1c63e90a015073b2d3da7f884b3991eff53b7d Mon Sep 17 00:00:00 2001 From: MaxOhn Date: Mon, 11 Nov 2024 12:08:36 +0100 Subject: [PATCH] chore: made clippy happy --- src/any/difficulty/mod.rs | 7 ++----- src/model/beatmap/attributes.rs | 9 ++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/any/difficulty/mod.rs b/src/any/difficulty/mod.rs index c0513b44..170e6f24 100644 --- a/src/any/difficulty/mod.rs +++ b/src/any/difficulty/mod.rs @@ -330,11 +330,8 @@ impl Difficulty { } pub(crate) fn get_clock_rate(&self) -> f64 { - let clock_rate = self - .clock_rate - .map_or(self.mods.clock_rate(), non_zero_u64_to_f64); - - f64::from(clock_rate) + self.clock_rate + .map_or(self.mods.clock_rate(), non_zero_u64_to_f64) } pub(crate) fn get_passed_objects(&self) -> usize { diff --git a/src/model/beatmap/attributes.rs b/src/model/beatmap/attributes.rs index 027cb7d1..4700ce8b 100644 --- a/src/model/beatmap/attributes.rs +++ b/src/model/beatmap/attributes.rs @@ -227,10 +227,7 @@ impl BeatmapAttributesBuilder { /// Calculate the AR and OD hit windows. pub fn hit_windows(&self) -> HitWindows { let mods = &self.mods; - - let clock_rate = self - .clock_rate - .unwrap_or_else(|| f64::from(mods.clock_rate())); + let clock_rate = self.clock_rate.unwrap_or_else(|| mods.clock_rate()); let ar_clock_rate = if self.ar.with_mods() { 1.0 } else { clock_rate }; let od_clock_rate = if self.od.with_mods() { 1.0 } else { clock_rate }; @@ -312,9 +309,7 @@ impl BeatmapAttributesBuilder { /// Calculate the [`BeatmapAttributes`]. pub fn build(&self) -> BeatmapAttributes { let mods = &self.mods; - let clock_rate = self - .clock_rate - .unwrap_or_else(|| f64::from(mods.clock_rate())); + let clock_rate = self.clock_rate.unwrap_or_else(|| mods.clock_rate()); // HP let mut hp = self.hp.value(mods, GameMods::hp);