diff --git a/src/decoder.rs b/src/decoder.rs index 9ec15ad..a9315d3 100644 --- a/src/decoder.rs +++ b/src/decoder.rs @@ -116,8 +116,8 @@ impl HeatshrinkDecoder { self.bit_index = 0; self.state = HSDstate::TagBit; // memset self.buffer to 0 - self.input_buffer.iter_mut().for_each(|m| *m = 0); - self.output_buffer.iter_mut().for_each(|m| *m = 0); + self.input_buffer.fill(0); + self.output_buffer.fill(0); } /// Add an input buffer to be processed/uncompressed diff --git a/src/encoder.rs b/src/encoder.rs index 34d993b..99063dc 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -166,11 +166,11 @@ impl HeatshrinkEncoder { self.bit_index = 8; self.state = HSEstate::NotFull; // memset self.buffer to 0 - self.input_buffer.iter_mut().for_each(|m| *m = 0); + self.input_buffer.fill(0); #[cfg(feature = "heatshrink-use-index")] { // memset self.search_index to 0 - self.search_index.iter_mut().for_each(|m| *m = None); + self.search_index.fill(None); } }