From bcaaa0dd5699a61b6d028f84bcbec7304367ed06 Mon Sep 17 00:00:00 2001 From: Olivier van der Toorn Date: Sun, 8 Sep 2024 09:24:16 +0200 Subject: [PATCH] Address linting errors Method max_values was replaced with constant MAX. This caused the linting check to fail. --- src/alsa_mixer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alsa_mixer.rs b/src/alsa_mixer.rs index 56645449..1ab90953 100644 --- a/src/alsa_mixer.rs +++ b/src/alsa_mixer.rs @@ -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)?;