mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
chore: cleanup some clippy errors
This commit is contained in:
@@ -337,7 +337,7 @@ fn testEncodeWithForcedCodeSetFailureCodeSetABadCharacter() {
|
|||||||
#[test]
|
#[test]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn testEncodeWithForcedCodeSetFailureCodeSetBBadCharacter() {
|
fn testEncodeWithForcedCodeSetFailureCodeSetBBadCharacter() {
|
||||||
let toEncode = "ASdf\00123"; // \0 (ascii value 0)
|
let toEncode = "ASdf\x000123"; // \0 (ascii value 0)
|
||||||
// Characters with ASCII value below 32 should not be accepted when the code set is forced to B.
|
// Characters with ASCII value below 32 should not be accepted when the code set is forced to B.
|
||||||
|
|
||||||
let mut hints = HashMap::new(); //new EnumMap<>(EncodeHintType.class);
|
let mut hints = HashMap::new(); //new EnumMap<>(EncodeHintType.class);
|
||||||
|
|||||||
@@ -244,12 +244,10 @@ mod TelepenWriterTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn doTest(input: &str, expected: &str, numeric: bool) {
|
fn doTest(input: &str, expected: &str, numeric: bool) {
|
||||||
let result: BitMatrix;
|
let result: BitMatrix = if numeric {
|
||||||
|
encode_with_hints(input)
|
||||||
if numeric {
|
|
||||||
result = encode_with_hints(input);
|
|
||||||
} else {
|
} else {
|
||||||
result = encode(input);
|
encode(input)
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(expected, bit_matrix_test_case::matrix_to_string(&result));
|
assert_eq!(expected, bit_matrix_test_case::matrix_to_string(&result));
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ pub fn FindFinderPatterns(image: &BitMatrix, tryHarder: bool) -> FinderPatterns
|
|||||||
next.iter().sum::<u16>() as i32 * 3,
|
next.iter().sum::<u16>() as i32 * 3,
|
||||||
); // 3 for very skewed samples
|
); // 3 for very skewed samples
|
||||||
// Reduce(next) * 3); // 3 for very skewed samples
|
// Reduce(next) * 3); // 3 for very skewed samples
|
||||||
if pattern.is_some() {
|
if let Some(p) = pattern {
|
||||||
// log(*pattern, 3);
|
// log(*pattern, 3);
|
||||||
// assert!(image.get_point(pattern.as_ref().unwrap().p));
|
// assert!(image.get_point(pattern.as_ref().unwrap().p));
|
||||||
res.push(pattern.unwrap());
|
res.push(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -697,15 +697,7 @@ pub fn SampleQR(image: &BitMatrix, fp: &FinderPatternSet) -> Result<QRCodeDetect
|
|||||||
let found = LocateAlignmentPattern(image, moduleSize, guessed);
|
let found = LocateAlignmentPattern(image, moduleSize, guessed);
|
||||||
// search again near that intersection and if the search fails, use the intersection
|
// search again near that intersection and if the search fails, use the intersection
|
||||||
// if (!found.is_some()) {printf("location guessed at %dx%d\n", x, y)};
|
// if (!found.is_some()) {printf("location guessed at %dx%d\n", x, y)};
|
||||||
apP.set(
|
apP.set(x, y, if let Some(f) = found { f } else { guessed });
|
||||||
x,
|
|
||||||
y,
|
|
||||||
if found.is_some() {
|
|
||||||
found.unwrap()
|
|
||||||
} else {
|
|
||||||
guessed
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user