diff --git a/src/decode/qr/correct.rs b/src/decode/qr/correct.rs index 3daefb6..6d02755 100644 --- a/src/decode/qr/correct.rs +++ b/src/decode/qr/correct.rs @@ -56,7 +56,7 @@ fn calculate_syndromes(block: &[u8], block_info: &BlockInfo) -> (bool, Vec) let mut all_fine = true; for i in 0..block_info.ec_cap * 2 { - syndromes[i as usize] = syndrome(&block, EXP8[i as usize]); + syndromes[i as usize] = syndrome(block, EXP8[i as usize]); if syndromes[i as usize] != GF8(0) { all_fine = false; } diff --git a/src/detect/linescan.rs b/src/detect/linescan.rs index 4138152..5a9b980 100644 --- a/src/detect/linescan.rs +++ b/src/detect/linescan.rs @@ -92,7 +92,7 @@ impl Detect for LineScan { // Step 2 // Run the refinement functions on the candidate location for (refine_func, dx, dy, is_diagonal) in &refine_func { - let vert = refine_func(&self, prepared, &finder, module_size); + let vert = refine_func(self, prepared, &finder, module_size); if vert.is_none() { last_pixel = p.channels()[0]; @@ -449,6 +449,7 @@ fn dist(one: &Point, other: &Point) -> f64 { } #[inline] +#[allow(clippy::manual_map)] fn find_qr(one: &Point, two: &Point, three: &Point, module_size: f64) -> Option { // Try all three combinations of points to see if any of them are a QR if let Some(qr) = find_qr_internal(one, two, three, module_size) { diff --git a/src/util/chomp.rs b/src/util/chomp.rs index 9d6c90d..e31e9cf 100644 --- a/src/util/chomp.rs +++ b/src/util/chomp.rs @@ -76,7 +76,7 @@ impl Chomp { /// If requesting fewer than 8 bits, the result will be in the least significant bits of the u8 pub fn chomp(&mut self, nr_bits: u8) -> Option { let bit_count = BitCount(nr_bits as usize); - if nr_bits < 1 || nr_bits > 8 || bit_count > self.bits_left { + if !(1..=8).contains(&nr_bits) || bit_count > self.bits_left { return None; }