From 57bd54c9942804583f687b45d5e1952ebc553e7c Mon Sep 17 00:00:00 2001 From: Ole-Jeger Hoffstuen Date: Tue, 7 May 2024 15:16:55 +0200 Subject: [PATCH] I must not have been thinking straight when comitting that last one --- src/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux.rs b/src/linux.rs index ae2bfba3..a84fd265 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -301,7 +301,7 @@ impl<'a> I2CTransfer<'a> for LinuxI2CDevice { /// Issue the provided sequence of I2C transactions fn transfer(&mut self, messages: &'a mut [Self::Message]) -> Result { let msg_type = |flag: u16| flag & I2CMessageFlags::READ.bits(); - let mut prev_msg_type = messages.first().map(|m| msg_type(m.flags)); + let mut prev_msg_type = None; for msg in messages.iter_mut() { msg.addr = self.slave_address;