Skip to content

Commit 894c76a

Browse files
authored
Use File.read_exact instead of File.read
1 parent 385ea5d commit 894c76a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/linux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl I2CDevice for LinuxI2CDevice {
175175

176176
/// Read data from the device to fill the provided slice
177177
fn read(&mut self, data: &mut [u8]) -> Result<(), LinuxI2CError> {
178-
self.devfile.read(data).map_err(From::from).map(drop)
178+
self.devfile.read_exact(data).map_err(From::from).map(drop)
179179
}
180180

181181
/// Write the provided buffer to the device

0 commit comments

Comments
 (0)