Skip to content

Commit ec10dcb

Browse files
committed
Improve casting
1 parent 20fc714 commit ec10dcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl I2cdev {
185185

186186
fn set_address(&mut self, address: u8) -> Result<(), i2cdev::linux::LinuxI2CError> {
187187
if self.address != Some(address) {
188-
self.inner = i2cdev::linux::LinuxI2CDevice::new(&self.path, address as u16)?;
188+
self.inner = i2cdev::linux::LinuxI2CDevice::new(&self.path, u16::from(address))?;
189189
self.address = Some(address);
190190
}
191191
Ok(())

0 commit comments

Comments
 (0)