mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
fairly major reorganization and clippy cleanup
This commit is contained in:
@@ -50,12 +50,14 @@ impl BarcodeValue {
|
||||
let mut result = Vec::new();
|
||||
for (key, value) in &self.0 {
|
||||
// for (Entry<Integer,Integer> entry : values.entrySet()) {
|
||||
if *value as i32 > maxConfidence {
|
||||
maxConfidence = *value as i32;
|
||||
result.clear();
|
||||
result.push(*key);
|
||||
} else if *value as i32 == maxConfidence {
|
||||
result.push(*key);
|
||||
match (*value as i32).cmp(&maxConfidence) {
|
||||
std::cmp::Ordering::Greater => {
|
||||
maxConfidence = *value as i32;
|
||||
result.clear();
|
||||
result.push(*key);
|
||||
}
|
||||
std::cmp::Ordering::Equal => result.push(*key),
|
||||
std::cmp::Ordering::Less => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -648,6 +648,7 @@ fn getStartColumn(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn detectCodeword(
|
||||
image: &BitMatrix,
|
||||
minColumn: u32,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
mod pdf_417_detector_result;
|
||||
pub use pdf_417_detector_result::*;
|
||||
|
||||
pub mod detector;
|
||||
pub mod pdf_417_detector;
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
decoder::pdf_417_scanning_decoder, detector::detector, pdf_417_common,
|
||||
decoder::pdf_417_scanning_decoder, detector::pdf_417_detector, pdf_417_common,
|
||||
PDF417RXingResultMetadata,
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ impl PDF417Reader {
|
||||
multiple: bool,
|
||||
) -> Result<Vec<RXingResult>, Exceptions> {
|
||||
let mut results = Vec::new(); //new ArrayList<>();
|
||||
let detectorRXingResult = detector::detect_with_hints(image, hints, multiple)?;
|
||||
let detectorRXingResult = pdf_417_detector::detect_with_hints(image, hints, multiple)?;
|
||||
for points in detectorRXingResult.getPoints() {
|
||||
let points_filtered = points.iter().filter_map(|e| *e).collect();
|
||||
// for (RXingResultPoint[] points : detectorRXingResult.getPoints()) {
|
||||
|
||||
Reference in New Issue
Block a user