mirror of
https://github.com/RustAudio/rodio
synced 2024-12-12 13:12:30 +00:00
fixes new clippy lints
This commit is contained in:
parent
ae9eaedc22
commit
297bd99bc1
2 changed files with 5 additions and 5 deletions
|
@ -196,7 +196,7 @@ where
|
|||
/// audiable when actually playing?
|
||||
fn f32_to_i16(f: f32) -> i16 {
|
||||
// prefer to clip the input rather than be excessively loud.
|
||||
(f.max(-1.0).min(1.0) * i16::max_value() as f32) as i16
|
||||
(f.clamp(-1.0, 1.0) * i16::MAX as f32) as i16
|
||||
}
|
||||
|
||||
/// Returns an 8-bit WAV int as an i16. This scales the sample value by a factor
|
||||
|
|
|
@ -272,7 +272,7 @@ impl CpalDeviceExt for cpal::Device {
|
|||
*d = mixer_rx
|
||||
.next()
|
||||
.map(Sample::from_sample)
|
||||
.unwrap_or(u8::max_value() / 2)
|
||||
.unwrap_or(u8::MAX / 2)
|
||||
})
|
||||
},
|
||||
error_callback,
|
||||
|
@ -285,7 +285,7 @@ impl CpalDeviceExt for cpal::Device {
|
|||
*d = mixer_rx
|
||||
.next()
|
||||
.map(Sample::from_sample)
|
||||
.unwrap_or(u16::max_value() / 2)
|
||||
.unwrap_or(u16::MAX / 2)
|
||||
})
|
||||
},
|
||||
error_callback,
|
||||
|
@ -298,7 +298,7 @@ impl CpalDeviceExt for cpal::Device {
|
|||
*d = mixer_rx
|
||||
.next()
|
||||
.map(Sample::from_sample)
|
||||
.unwrap_or(u32::max_value() / 2)
|
||||
.unwrap_or(u32::MAX / 2)
|
||||
})
|
||||
},
|
||||
error_callback,
|
||||
|
@ -311,7 +311,7 @@ impl CpalDeviceExt for cpal::Device {
|
|||
*d = mixer_rx
|
||||
.next()
|
||||
.map(Sample::from_sample)
|
||||
.unwrap_or(u64::max_value() / 2)
|
||||
.unwrap_or(u64::MAX / 2)
|
||||
})
|
||||
},
|
||||
error_callback,
|
||||
|
|
Loading…
Reference in a new issue