From 894c76a342f83e3314f419dbcc7655d52af3ca24 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 2 Jun 2022 12:26:07 -0700 Subject: [PATCH] Use File.read_exact instead of File.read --- src/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux.rs b/src/linux.rs index 67d09ff3..f75439bb 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -175,7 +175,7 @@ impl I2CDevice for LinuxI2CDevice { /// Read data from the device to fill the provided slice fn read(&mut self, data: &mut [u8]) -> Result<(), LinuxI2CError> { - self.devfile.read(data).map_err(From::from).map(drop) + self.devfile.read_exact(data).map_err(From::from).map(drop) } /// Write the provided buffer to the device