clippy fix

This commit is contained in:
Henry
2023-01-04 18:29:08 -06:00
parent 7074daa94d
commit 9a5d6a704b
2 changed files with 14 additions and 22 deletions

View File

@@ -36,15 +36,13 @@ pub fn detect_in_file_with_hints(
);
}
if !hints.contains_key(&DecodeHintType::TRY_HARDER) {
hints.insert(DecodeHintType::TRY_HARDER, DecodeHintValue::TryHarder(true));
}
hints.entry(DecodeHintType::TRY_HARDER).or_insert(DecodeHintValue::TryHarder(true));
multi_format_reader.decode_with_hints(
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
BufferedImageLuminanceSource::new(img),
))))),
&hints,
hints,
)
}
@@ -62,15 +60,13 @@ pub fn detect_multiple_in_file_with_hints(
let multi_format_reader = MultiFormatReader::default();
let mut scanner = GenericMultipleBarcodeReader::new(multi_format_reader);
if !hints.contains_key(&DecodeHintType::TRY_HARDER) {
hints.insert(DecodeHintType::TRY_HARDER, DecodeHintValue::TryHarder(true));
}
hints.entry(DecodeHintType::TRY_HARDER).or_insert(DecodeHintValue::TryHarder(true));
scanner.decode_multiple_with_hints(
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
BufferedImageLuminanceSource::new(img),
))))),
&hints,
hints,
)
}
@@ -99,15 +95,13 @@ pub fn detect_in_luma_with_hints(
);
}
if !hints.contains_key(&DecodeHintType::TRY_HARDER) {
hints.insert(DecodeHintType::TRY_HARDER, DecodeHintValue::TryHarder(true));
}
hints.entry(DecodeHintType::TRY_HARDER).or_insert(DecodeHintValue::TryHarder(true));
multi_format_reader.decode_with_hints(
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
Luma8LuminanceSource::new(luma, width, height),
))))),
&hints,
hints,
)
}
@@ -128,14 +122,12 @@ pub fn detect_multiple_in_luma_with_hints(
let multi_format_reader = MultiFormatReader::default();
let mut scanner = GenericMultipleBarcodeReader::new(multi_format_reader);
if !hints.contains_key(&DecodeHintType::TRY_HARDER) {
hints.insert(DecodeHintType::TRY_HARDER, DecodeHintValue::TryHarder(true));
}
hints.entry(DecodeHintType::TRY_HARDER).or_insert(DecodeHintValue::TryHarder(true));
scanner.decode_multiple_with_hints(
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
Luma8LuminanceSource::new(luma, width, height),
))))),
&hints,
hints,
)
}