Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
bastibl committed Dec 4, 2023
1 parent 9862bae commit 3d27d07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/wlan/src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl Encoder {
Ok(Pmt::Null)
}

fn generate_bits(&mut self, data: &Vec<u8>) {
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);
Expand Down Expand Up @@ -219,7 +219,7 @@ impl Encoder {
}
}

fn encode(&mut self, data: &Vec<u8>, 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());
Expand Down
2 changes: 1 addition & 1 deletion examples/wlan/src/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Mac {
Ok(Pmt::Null)
}

fn generate_mac_data_frame(&mut self, data: &Vec<u8>) -> 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);

Expand Down

0 comments on commit 3d27d07

Please sign in to comment.