Skip to content

Commit

Permalink
Address linting errors
Browse files Browse the repository at this point in the history
Method max_values was replaced with constant MAX. This caused the
linting check to fail.
  • Loading branch information
lordievader committed Sep 8, 2024
1 parent c2793da commit bcaaa0d
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 bcaaa0d

Please sign in to comment.