Simplify range

pull/4/head
Diego Barrios Romero 2018-11-16 17:45:03 +01:00
parent 06e5aaddf3
commit a7c3f0c83a
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ where
fn read_data(&mut self, payload: &mut [u8]) -> Result<(), Error<Self::Error>> { fn read_data(&mut self, payload: &mut [u8]) -> Result<(), Error<Self::Error>> {
let len = payload.len(); let len = payload.len();
self.i2c self.i2c
.write_read(DEVICE_ADDRESS, &[payload[0]], &mut payload[1..=(len-1)]) .write_read(DEVICE_ADDRESS, &[payload[0]], &mut payload[1..len])
.map_err(Error::Comm) .map_err(Error::Comm)
} }
} }