Skip to content

Commit

Permalink
chore: apply some clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Dec 22, 2024
1 parent 4a5f45c commit 5c87b4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common/cpp_essentials/fast_edge_to_edge_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct FastEdgeToEdgeCounter<'a> {
under_arry: &'a BitMatrix, //,Vec<bool>
}

impl<'a> FastEdgeToEdgeCounter<'a> {
impl FastEdgeToEdgeCounter<'_> {
pub fn new<T: BitMatrixCursorTrait>(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)
Expand Down
2 changes: 1 addition & 1 deletion src/datamatrix/encoder/symbol_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/oned/code_128_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions tests/github_issues.rs
Original file line number Diff line number Diff line change
@@ -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,
};

Expand Down Expand Up @@ -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;
Expand All @@ -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::<String>();

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");
Expand Down

0 comments on commit 5c87b4b

Please sign in to comment.