diff --git a/ctru-rs/examples/audio_filters.rs b/ctru-rs/examples/audio_filters.rs index 6ef6122..8fc2124 100644 --- a/ctru-rs/examples/audio_filters.rs +++ b/ctru-rs/examples/audio_filters.rs @@ -80,12 +80,14 @@ fn main() { // We set up two wave buffers and alternate between the two, // effectively streaming an infinitely long sine wave. - let mut audio_data1 = Box::new_in([0u8; AUDIO_WAVE_LENGTH], LinearAllocator); + let mut audio_data1 = Box::new_in([0u8; AUDIO_WAVE_LENGTH], LinearAllocator); fill_buffer(&mut audio_data1[..], NOTEFREQ[4]); - let mut audio_data2 = audio_data1.clone(); + let mut audio_data2 = audio_data1.clone(); - let mut audio_buffer1 = WaveBuffer::new(audio_data1, AudioFormat::PCM16Stereo).expect("Couldn't sync DSP cache"); - let mut audio_buffer2 = WaveBuffer::new(audio_data2, AudioFormat::PCM16Stereo).expect("Couldn't sync DSP cache"); + let mut audio_buffer1 = + WaveBuffer::new(audio_data1, AudioFormat::PCM16Stereo).expect("Couldn't sync DSP cache"); + let mut audio_buffer2 = + WaveBuffer::new(audio_data2, AudioFormat::PCM16Stereo).expect("Couldn't sync DSP cache"); let mut wave_info1 = WaveInfo::new(&mut audio_buffer1, false); let mut wave_info2 = WaveInfo::new(&mut audio_buffer2, false); diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index f299ce2..7a60242 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -151,7 +151,7 @@ impl Channel { unsafe { ctru_sys::ndspChnWaveBufClear(self.id) }; } - /// Add a wave buffer to the channel's queue. + /// Add a wave buffer to the channel's queue. /// If there are no other buffers in queue, playback for this buffer will start. /// /// # Warning diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 540adb7..50a868a 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -93,7 +93,11 @@ impl<'b> WaveInfo<'b> { next: std::ptr::null_mut(), }; - Self { buffer, raw_data, played_on_channel: None,} + Self { + buffer, + raw_data, + played_on_channel: None, + } } pub fn get_mut_wavebuffer(&mut self) -> &mut WaveBuffer { @@ -144,7 +148,7 @@ impl<'b> Drop for WaveInfo<'b> { // If the status flag is "unfinished" _ => { // The unwrap is safe, since it must have a value in the case the status is "unfinished". - unsafe { ndspChnWaveBufClear(self.played_on_channel.unwrap().into() )}; + unsafe { ndspChnWaveBufClear(self.played_on_channel.unwrap().into()) }; } } }