From 3d27d07548597f6839b8d982583dc3b03f88236d Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Mon, 4 Dec 2023 12:19:13 +0100 Subject: [PATCH] clippy --- examples/wlan/src/encoder.rs | 4 ++-- examples/wlan/src/mac.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/wlan/src/encoder.rs b/examples/wlan/src/encoder.rs index 6b2922356..c65c7fec1 100644 --- a/examples/wlan/src/encoder.rs +++ b/examples/wlan/src/encoder.rs @@ -122,7 +122,7 @@ impl Encoder { Ok(Pmt::Null) } - fn generate_bits(&mut self, data: &Vec) { + fn generate_bits(&mut self, data: &[u8]) { for i in 0..data.len() { for b in 0..8 { self.bits[16 + i * 8 + b] = u8::from((data[i] & (1 << b)) > 0); @@ -219,7 +219,7 @@ impl Encoder { } } - fn encode(&mut self, data: &Vec, frame: &FrameParam) { + fn encode(&mut self, data: &[u8], frame: &FrameParam) { self.generate_bits(data); self.scramble(frame.n_data_bits(), frame.n_pad()); self.convolutional_encode(frame.n_data_bits()); diff --git a/examples/wlan/src/mac.rs b/examples/wlan/src/mac.rs index e5c9e39ce..3502bdbdb 100644 --- a/examples/wlan/src/mac.rs +++ b/examples/wlan/src/mac.rs @@ -103,7 +103,7 @@ impl Mac { Ok(Pmt::Null) } - fn generate_mac_data_frame(&mut self, data: &Vec) -> usize { + fn generate_mac_data_frame(&mut self, data: &[u8]) -> usize { self.current_frame[22..24].copy_from_slice(&(self.sequence_number << 4).to_le_bytes()); self.sequence_number = (self.sequence_number + 1) % (1 << 12);