Skip to content

Commit

Permalink
Fix clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLG1979 committed Jun 22, 2023
1 parent efec96b commit 838855b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions playback/src/audio_backend/portaudio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{Open, Sink, SinkError, SinkResult};
use crate::config::AudioFormat;
use crate::convert::Converter;
use crate::decoder::AudioPacket;
use crate::{NUM_CHANNELS, SAMPLE_RATE};
use crate::NUM_CHANNELS;
use portaudio_rs::device::{get_default_output_index, DeviceIndex, DeviceInfo};
use portaudio_rs::stream::*;
use std::process::exit;
Expand Down Expand Up @@ -141,9 +141,9 @@ impl<'a> Sink for PortAudioSink<'a> {
}};
}
match self {
Self::F32(stream, _) => stop_sink!(ref mut stream),
Self::S32(stream, _) => stop_sink!(ref mut stream),
Self::S16(stream, _) => stop_sink!(ref mut stream),
Self::F32(stream, _, _) => stop_sink!(ref mut stream),
Self::S32(stream, _, _) => stop_sink!(ref mut stream),
Self::S16(stream, _, _) => stop_sink!(ref mut stream),
};

Ok(())
Expand All @@ -161,15 +161,15 @@ impl<'a> Sink for PortAudioSink<'a> {
.map_err(|e| SinkError::OnWrite(e.to_string()))?;

let result = match self {
Self::F32(stream, _parameters) => {
Self::F32(stream, _parameters, _sample_rate) => {
let samples_f32: &[f32] = &converter.f64_to_f32(samples);
write_sink!(ref mut stream, samples_f32)
}
Self::S32(stream, _parameters) => {
Self::S32(stream, _parameters, _sample_rate) => {
let samples_s32: &[i32] = &converter.f64_to_s32(samples);
write_sink!(ref mut stream, samples_s32)
}
Self::S16(stream, _parameters) => {
Self::S16(stream, _parameters, _sample_rate) => {
let samples_s16: &[i16] = &converter.f64_to_s16(samples);
write_sink!(ref mut stream, samples_s16)
}
Expand Down

0 comments on commit 838855b

Please sign in to comment.