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]
|
||||
#[should_panic]
|
||||
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.
|
||||
|
||||
let mut hints = HashMap::new(); //new EnumMap<>(EncodeHintType.class);
|
||||
|
||||
@@ -244,12 +244,10 @@ mod TelepenWriterTestCase {
|
||||
}
|
||||
|
||||
fn doTest(input: &str, expected: &str, numeric: bool) {
|
||||
let result: BitMatrix;
|
||||
|
||||
if numeric {
|
||||
result = encode_with_hints(input);
|
||||
let result: BitMatrix = if numeric {
|
||||
encode_with_hints(input)
|
||||
} else {
|
||||
result = encode(input);
|
||||
encode(input)
|
||||
};
|
||||
|
||||
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,
|
||||
); // 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);
|
||||
// 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);
|
||||
// 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)};
|
||||
apP.set(
|
||||
x,
|
||||
y,
|
||||
if found.is_some() {
|
||||
found.unwrap()
|
||||
} else {
|
||||
guessed
|
||||
},
|
||||
);
|
||||
apP.set(x, y, if let Some(f) = found { f } else { guessed });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user