Skip to content

Commit

Permalink
Use File.read_exact instead of File.read
Browse files Browse the repository at this point in the history
  • Loading branch information
jath03 authored Jun 2, 2022
1 parent 385ea5d commit 894c76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 894c76a

Please sign in to comment.