Skip to content

Commit

Permalink
chore: made clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Nov 11, 2024
1 parent 757b57b commit 4f1c63e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
7 changes: 2 additions & 5 deletions src/any/difficulty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 2 additions & 7 deletions src/model/beatmap/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4f1c63e

Please sign in to comment.