mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Fix clippy warnings
This commit is contained in:
parent
6a98a0138c
commit
1290ee9925
4 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue