diff --git a/src/blockdevice.rs b/src/blockdevice.rs index 618eda2..fcc1d43 100644 --- a/src/blockdevice.rs +++ b/src/blockdevice.rs @@ -140,9 +140,7 @@ where /// Access a blank sector pub fn blank_mut(&mut self, block_idx: BlockIdx) -> &mut Block { self.block_idx = Some(block_idx); - for b in self.block[0].iter_mut() { - *b = 0; - } + self.block[0].fill(0); &mut self.block[0] } diff --git a/src/sdcard/mod.rs b/src/sdcard/mod.rs index 5c3c038..553791f 100644 --- a/src/sdcard/mod.rs +++ b/src/sdcard/mod.rs @@ -341,9 +341,7 @@ where return Err(Error::ReadError); } - for b in buffer.iter_mut() { - *b = 0xFF; - } + buffer.fill(0xFF); self.transfer_bytes(buffer)?; // These two bytes are always sent. They are either a valid CRC, or