Closed jath03 closed 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
I2CDevice.read
File.read
File.read_exact
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.
Build succeeded:
As the documentation says,
I2CDevice.read
is supposed to "fill the provided slice", whichFile.read
on it's own doesn't do. UsingFile.read_exact
instead will accomplish the intended behavior. https://doc.rust-lang.org/std/fs/struct.File.html#method.read_exact-1