diff options
Diffstat (limited to 'ble/src/i2c.rs')
-rw-r--r-- | ble/src/i2c.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ble/src/i2c.rs b/ble/src/i2c.rs index 0f7fe5e..b5a5114 100644 --- a/ble/src/i2c.rs +++ b/ble/src/i2c.rs @@ -39,11 +39,9 @@ where let mut buf: [u8; 255] = [0; 255]; match twis.read(&mut buf) { Ok(len) => { - for b in &buf[0..len] { - // Ignore unshift errors for now, as I don't think - // there's much we can do about it. - writer.unshift(*b).ok(); - } + // Ignore unshift overflow for now, as I don't think + // there's much we can do about it. + writer.unshift_from(&buf[0..len]); trace!("write done"); } Err(e) => error!("{:?}", e), |