From 5c87b4b2dae761719816c98de9a525953f9e2dc6 Mon Sep 17 00:00:00 2001 From: Henry Schimke Date: Sat, 21 Dec 2024 18:47:40 -0600 Subject: [PATCH] chore: apply some clippy suggestions --- src/common/cpp_essentials/fast_edge_to_edge_counter.rs | 2 +- src/datamatrix/encoder/symbol_info.rs | 2 +- src/oned/code_128_reader.rs | 2 +- tests/github_issues.rs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/cpp_essentials/fast_edge_to_edge_counter.rs b/src/common/cpp_essentials/fast_edge_to_edge_counter.rs index 263d0c1c..2471df50 100644 --- a/src/common/cpp_essentials/fast_edge_to_edge_counter.rs +++ b/src/common/cpp_essentials/fast_edge_to_edge_counter.rs @@ -14,7 +14,7 @@ pub struct FastEdgeToEdgeCounter<'a> { under_arry: &'a BitMatrix, //,Vec } -impl<'a> FastEdgeToEdgeCounter<'a> { +impl FastEdgeToEdgeCounter<'_> { pub fn new(cur: &T) -> FastEdgeToEdgeCounter { let stride = cur.d().y as isize * cur.img().width() as isize + cur.d().x as isize; let p = ((cur.p().y as isize * cur.img().width() as isize).abs() as i32 + cur.p().x as i32) diff --git a/src/datamatrix/encoder/symbol_info.rs b/src/datamatrix/encoder/symbol_info.rs index 847f5a2d..90fd6451 100644 --- a/src/datamatrix/encoder/symbol_info.rs +++ b/src/datamatrix/encoder/symbol_info.rs @@ -232,7 +232,7 @@ impl fmt::Display for SymbolInfo { #[derive(Clone, Copy)] pub struct SymbolInfoLookup<'a>(Option<&'a [SymbolInfo]>); -impl<'a> Default for SymbolInfoLookup<'a> { +impl Default for SymbolInfoLookup<'_> { fn default() -> Self { Self::new() } diff --git a/src/oned/code_128_reader.rs b/src/oned/code_128_reader.rs index 8acfe88e..894680dd 100644 --- a/src/oned/code_128_reader.rs +++ b/src/oned/code_128_reader.rs @@ -373,7 +373,7 @@ impl Code128Reader { for startCode in CODE_START_A..=CODE_START_C { let variance = one_d_reader::pattern_match_variance( &counters, - &CODE_PATTERNS[startCode as usize], + CODE_PATTERNS[startCode as usize], MAX_INDIVIDUAL_VARIANCE, ); if variance < bestVariance { diff --git a/tests/github_issues.rs b/tests/github_issues.rs index d35f3490..9e50badd 100644 --- a/tests/github_issues.rs +++ b/tests/github_issues.rs @@ -1,8 +1,8 @@ -use std::{io::Read, u8}; +use std::io::Read; use image::DynamicImage; use rxing::{ - datamatrix::DataMatrixReader, DecodingHintDictionary, Dimension, EncodingHintDictionary, + DecodingHintDictionary, Dimension, EncodingHintDictionary, Reader, Writer, }; @@ -592,7 +592,7 @@ fn issue_58() { #[test] fn issue_59() { use rand::prelude::*; - use rxing::{BufferedImageLuminanceSource, Luma8LuminanceSource}; + use rxing::BufferedImageLuminanceSource; const TEST_SIZE: usize = 1556; const TEST_2_SIZE: usize = 100; @@ -601,7 +601,7 @@ fn issue_59() { rand::thread_rng().fill_bytes(&mut rnd_data); let data = rnd_data.iter().map(|c| *c as char).collect::(); - let writer = rxing::datamatrix::DataMatrixWriter::default(); + let writer = rxing::datamatrix::DataMatrixWriter; let data_matrix = writer .encode(&data, &rxing::BarcodeFormat::DATA_MATRIX, 0, 0) .expect("must encode with size of 500");