Skip to content

Commit

Permalink
chore: clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Dec 23, 2024
1 parent b5546ca commit 9babaf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/common/bit_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,11 @@ impl From<&BitArray> for Vec<bool> {
}
}

impl Into<BitArray> for Vec<u8> {
fn into(self) -> BitArray {
let mut new_array = BitArray::with_capacity(self.len());
for (pos, byte) in self.into_iter().enumerate() {
match byte {
0 => new_array.set(pos),
_ => {}
}
impl From<Vec<u8>> for BitArray {
fn from(val: Vec<u8>) -> Self {
let mut new_array = BitArray::with_capacity(val.len());
for (pos, byte) in val.into_iter().enumerate() {
if byte == 0 { new_array.set(pos) }
}
new_array
}
Expand Down
2 changes: 1 addition & 1 deletion src/datamatrix/encoder/error_correction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn createECCBlock(codewords: &[u8], numECWords: usize) -> Result<Vec<u8>> {
))
})?;

let poly = FACTORS[table as usize];
let poly = FACTORS[table];
let mut ecc = vec![0u8; numECWords];
for codeword in codewords {
let m = ecc[numECWords - 1] as usize ^ *codeword as usize;
Expand Down

0 comments on commit 9babaf9

Please sign in to comment.