Skip to content

Commit

Permalink
Merge pull request rust-embedded#55 from eldruin/compat-1.31.0
Browse files Browse the repository at this point in the history
Make compatible with Rust 1.31.0 and prepare patch release
  • Loading branch information
posborne authored Dec 2, 2019
2 parents 5f00148 + 2210487 commit b6b4065
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "i2cdev"
version = "0.4.3"
version = "0.4.4"
authors = ["Paul Osborne <[email protected]>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-embedded/rust-i2cdev"
Expand Down
3 changes: 2 additions & 1 deletion src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ impl I2CRegisterMap {
impl I2CRegisterMap {
/// Read data from the device to fill the provided slice
fn read(&mut self, data: &mut [u8]) -> I2CResult<()> {
data.clone_from_slice(&self.registers[self.offset..(self.offset + data.len())]);
let len = data.len();
data.clone_from_slice(&self.registers[self.offset..(self.offset + len)]);
println!("READ | 0x{:X} : {:?}", self.offset - data.len(), data);
Ok(())
}
Expand Down

0 comments on commit b6b4065

Please sign in to comment.