Skip to content

Commit

Permalink
Merge pull request Spotifyd#1302 from eladyn/clippy_fixes
Browse files Browse the repository at this point in the history
clippy: use u16::MAX instead of max_value()
  • Loading branch information
eladyn authored Sep 5, 2024
2 parents e342328 + d22ae6e commit e280d84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/alsa_mixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ impl AlsaMixer {

let volume_steps = (max - min) as f64;
let normalised_volume = if self.linear_scaling {
((f64::from(volume) / f64::from(u16::max_value())) * volume_steps) as i64 + min
((f64::from(volume) / f64::from(u16::MAX)) * volume_steps) as i64 + min
} else {
(f64::from(volume).log(f64::from(u16::max_value())) * volume_steps).floor() as i64 + min
(f64::from(volume).log(f64::from(u16::MAX)) * volume_steps).floor() as i64 + min
};

elem.set_playback_volume_all(normalised_volume)?;
Expand Down

0 comments on commit e280d84

Please sign in to comment.