From 6b8ab32536bf2e831ec424b5aaf489bb1f53d017 Mon Sep 17 00:00:00 2001 From: Christian Perez Llamas <932644+chris-zen@users.noreply.github.com> Date: Sat, 26 Nov 2022 15:22:31 +0100 Subject: [PATCH] Use &mut self for start methods --- embassy-nrf/src/i2s.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/embassy-nrf/src/i2s.rs b/embassy-nrf/src/i2s.rs index d5815160a..bc90dbc98 100644 --- a/embassy-nrf/src/i2s.rs +++ b/embassy-nrf/src/i2s.rs @@ -645,7 +645,8 @@ pub struct OutputStream<'d, T: Instance> { impl<'d, T: Instance> OutputStream<'d, T> { /// Prepare the initial buffer and start the I2S transfer. - pub async fn start(&self, buffer: &[S]) -> Result<(), Error> + #[allow(unused_mut)] + pub async fn start(&mut self, buffer: &[S]) -> Result<(), Error> where S: Sample, { @@ -694,7 +695,8 @@ pub struct InputStream<'d, T: Instance> { impl<'d, T: Instance> InputStream<'d, T> { /// Prepare the initial buffer and start the I2S transfer. - pub async fn start(&self, buffer: &mut [S]) -> Result<(), Error> + #[allow(unused_mut)] + pub async fn start(&mut self, buffer: &mut [S]) -> Result<(), Error> where S: Sample, { @@ -743,7 +745,8 @@ pub struct FullDuplexStream<'d, T: Instance> { impl<'d, T: Instance> FullDuplexStream<'d, T> { /// Prepare the initial buffers and start the I2S transfer. - pub async fn start(&self, buffer_out: &[S], buffer_in: &mut [S]) -> Result<(), Error> + #[allow(unused_mut)] + pub async fn start(&mut self, buffer_out: &[S], buffer_in: &mut [S]) -> Result<(), Error> where S: Sample, {