Fix clippy lint round 1000 + a small bug fix

This commit is contained in:
JasonLG1979 2023-06-22 01:39:54 -05:00
parent 2a8da828c4
commit 586e9f1929
2 changed files with 8 additions and 15 deletions

View file

@ -86,10 +86,13 @@ impl<'a> Open for PortAudioSink<'a> {
$sink(None, params, $sample_rate)
}};
}
let sample_rate = sample_rate as f64;
match format {
AudioFormat::F32 => open_sink!(Self::F32, f32, sample_rate as f64),
AudioFormat::S32 => open_sink!(Self::S32, i32, sample_rate as f64),
AudioFormat::S16 => open_sink!(Self::S16, i16, sample_rate as f64),
AudioFormat::F32 => open_sink!(Self::F32, f32, sample_rate),
AudioFormat::S32 => open_sink!(Self::S32, i32, sample_rate),
AudioFormat::S16 => open_sink!(Self::S16, i16, sample_rate),
_ => {
unimplemented!("PortAudio currently does not support {format:?} output")
}

View file

@ -1562,12 +1562,7 @@ fn get_setup() -> Setup {
NORMALISATION_ATTACK_SHORT,
&attack,
valid_values,
&sample_rate
.normalisation_coefficient_to_duration(
player_default_config.normalisation_attack_cf,
)
.as_millis()
.to_string(),
"5",
);
exit(1);
@ -1595,12 +1590,7 @@ fn get_setup() -> Setup {
NORMALISATION_RELEASE_SHORT,
&release,
valid_values,
&sample_rate
.normalisation_coefficient_to_duration(
player_default_config.normalisation_release_cf,
)
.as_millis()
.to_string(),
"100",
);
exit(1);