chore: made clippy happy

This commit is contained in:
MaxOhn
2024-11-11 12:08:36 +01:00
parent 757b57bfa0
commit 4f1c63e90a
2 changed files with 4 additions and 12 deletions
+2 -5
View File
@@ -330,11 +330,8 @@ impl Difficulty {
} }
pub(crate) fn get_clock_rate(&self) -> f64 { pub(crate) fn get_clock_rate(&self) -> f64 {
let clock_rate = self self.clock_rate
.clock_rate .map_or(self.mods.clock_rate(), non_zero_u64_to_f64)
.map_or(self.mods.clock_rate(), non_zero_u64_to_f64);
f64::from(clock_rate)
} }
pub(crate) fn get_passed_objects(&self) -> usize { pub(crate) fn get_passed_objects(&self) -> usize {
+2 -7
View File
@@ -227,10 +227,7 @@ impl BeatmapAttributesBuilder {
/// Calculate the AR and OD hit windows. /// Calculate the AR and OD hit windows.
pub fn hit_windows(&self) -> HitWindows { pub fn hit_windows(&self) -> HitWindows {
let mods = &self.mods; let mods = &self.mods;
let clock_rate = self.clock_rate.unwrap_or_else(|| mods.clock_rate());
let clock_rate = self
.clock_rate
.unwrap_or_else(|| f64::from(mods.clock_rate()));
let ar_clock_rate = if self.ar.with_mods() { 1.0 } else { 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 }; let od_clock_rate = if self.od.with_mods() { 1.0 } else { clock_rate };
@@ -312,9 +309,7 @@ impl BeatmapAttributesBuilder {
/// Calculate the [`BeatmapAttributes`]. /// Calculate the [`BeatmapAttributes`].
pub fn build(&self) -> BeatmapAttributes { pub fn build(&self) -> BeatmapAttributes {
let mods = &self.mods; let mods = &self.mods;
let clock_rate = self let clock_rate = self.clock_rate.unwrap_or_else(|| mods.clock_rate());
.clock_rate
.unwrap_or_else(|| f64::from(mods.clock_rate()));
// HP // HP
let mut hp = self.hp.value(mods, GameMods::hp); let mut hp = self.hp.value(mods, GameMods::hp);