Use &mut self for start methods

This commit is contained in:
Christian Perez Llamas 2022-11-26 15:22:31 +01:00
parent 15a93246d6
commit 6b8ab32536

View file

@ -645,7 +645,8 @@ pub struct OutputStream<'d, T: Instance> {
impl<'d, T: Instance> OutputStream<'d, T> { impl<'d, T: Instance> OutputStream<'d, T> {
/// Prepare the initial buffer and start the I2S transfer. /// Prepare the initial buffer and start the I2S transfer.
pub async fn start<S>(&self, buffer: &[S]) -> Result<(), Error> #[allow(unused_mut)]
pub async fn start<S>(&mut self, buffer: &[S]) -> Result<(), Error>
where where
S: Sample, S: Sample,
{ {
@ -694,7 +695,8 @@ pub struct InputStream<'d, T: Instance> {
impl<'d, T: Instance> InputStream<'d, T> { impl<'d, T: Instance> InputStream<'d, T> {
/// Prepare the initial buffer and start the I2S transfer. /// Prepare the initial buffer and start the I2S transfer.
pub async fn start<S>(&self, buffer: &mut [S]) -> Result<(), Error> #[allow(unused_mut)]
pub async fn start<S>(&mut self, buffer: &mut [S]) -> Result<(), Error>
where where
S: Sample, S: Sample,
{ {
@ -743,7 +745,8 @@ pub struct FullDuplexStream<'d, T: Instance> {
impl<'d, T: Instance> FullDuplexStream<'d, T> { impl<'d, T: Instance> FullDuplexStream<'d, T> {
/// Prepare the initial buffers and start the I2S transfer. /// Prepare the initial buffers and start the I2S transfer.
pub async fn start<S>(&self, buffer_out: &[S], buffer_in: &mut [S]) -> Result<(), Error> #[allow(unused_mut)]
pub async fn start<S>(&mut self, buffer_out: &[S], buffer_in: &mut [S]) -> Result<(), Error>
where where
S: Sample, S: Sample,
{ {