rust-embedded / rust-i2cdev

Rust library for interfacing with i2c devices under Linux
Apache License 2.0
205 stars 53 forks source link

Use File.read_exact instead of File.read #73

Closed jath03 closed 2 years ago

jath03 commented 2 years ago

As the documentation says, I2CDevice.read is supposed to "fill the provided slice", which File.read on it's own doesn't do. Using File.read_exact instead will accomplish the intended behavior. https://doc.rust-lang.org/std/fs/struct.File.html#method.read_exact-1

rust-highfive commented 2 years ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nastevens (or someone else) soon.

Please see the contribution instructions for more information.

bors[bot] commented 2 years ago

Build succeeded: