From cff665f2ecf2c60358534cd4dfe06b1a469d45fa Mon Sep 17 00:00:00 2001 From: Sebastian Goll Date: Wed, 20 Mar 2024 13:08:42 +0100 Subject: [PATCH] Avoid unnecessary double-reference --- embassy-stm32/src/i2c/v1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index c96935d8f..f1ed7ca40 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs @@ -403,7 +403,7 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> { let mut prev_op: Option<&mut Operation<'_>> = None; let mut next_op = operations.next(); - while let Some(mut op) = next_op { + while let Some(op) = next_op { next_op = operations.next(); // Check if this is the first frame of this type. This is the case for the first overall @@ -439,7 +439,7 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> { (false, Some(Operation::Write(_))) => FrameOptions::LastFrameNoStop, }; - match &mut op { + match op { Operation::Read(read) => self.blocking_read_timeout(addr, read, timeout, frame)?, Operation::Write(write) => self.write_bytes(addr, write, timeout, frame)?, }