Fix clippy warnings

This commit is contained in:
Roderick van Domburg 2022-04-07 22:32:43 +02:00
parent 6a98a0138c
commit 1290ee9925
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
4 changed files with 5 additions and 5 deletions

View file

@ -139,7 +139,7 @@ enum ControlFlow {
}
impl AudioFileFetch {
fn is_download_streaming(&mut self) -> bool {
fn is_download_streaming(&self) -> bool {
self.shared.download_streaming.load(Ordering::Acquire)
}

View file

@ -191,7 +191,7 @@ impl Mixer for AlsaMixer {
mapped_volume = LogMapping::linear_to_mapped(mapped_volume, self.db_range);
}
self.config.volume_ctrl.from_mapped(mapped_volume)
self.config.volume_ctrl.as_unmapped(mapped_volume)
}
fn set_volume(&self, volume: u16) {

View file

@ -3,7 +3,7 @@ use crate::player::db_to_ratio;
pub trait MappedCtrl {
fn to_mapped(&self, volume: u16) -> f64;
fn from_mapped(&self, mapped_volume: f64) -> u16;
fn as_unmapped(&self, mapped_volume: f64) -> u16;
fn db_range(&self) -> f64;
fn set_db_range(&mut self, new_db_range: f64);
@ -49,7 +49,7 @@ impl MappedCtrl for VolumeCtrl {
mapped_volume
}
fn from_mapped(&self, mapped_volume: f64) -> u16 {
fn as_unmapped(&self, mapped_volume: f64) -> u16 {
// More than just an optimization, this ensures that zero mapped volume
// is unmapped to non-negative real numbers (otherwise the log and cubic
// equations would respectively return -inf and -1/9.)

View file

@ -26,7 +26,7 @@ impl Mixer for SoftMixer {
fn volume(&self) -> u16 {
let mapped_volume = f64::from_bits(self.volume.load(Ordering::Relaxed));
self.volume_ctrl.from_mapped(mapped_volume)
self.volume_ctrl.as_unmapped(mapped_volume)
}
fn set_volume(&self, volume: u16) {