cargo clippy --fix

This commit is contained in:
Henry Schimke
2023-03-01 10:50:52 -06:00
parent 42efbb397d
commit f450c6e0f7
4 changed files with 6 additions and 10 deletions

View File

@@ -162,7 +162,7 @@ fn get_encoded_data(corrected_bits: &[bool]) -> Result<String> {
result.push_str(
&encdr
.decode(&decoded_bytes, encoding::DecoderTrap::Strict)
.map_err(|a| Exceptions::illegalStateWith(a))?,
.map_err(Exceptions::illegalStateWith)?,
);
decoded_bytes.clear();

View File

@@ -732,7 +732,7 @@ fn decodeBase256Segment(
result.append_string(
&encoding::all::ISO_8859_1
.decode(&bytes, encoding::DecoderTrap::Strict)
.map_err(|e| Exceptions::parseWith(e))?,
.map_err(Exceptions::parseWith)?,
);
byteSegments.push(bytes);

View File

@@ -340,8 +340,8 @@ pub fn detect(image: &BitMatrix, try_harder: bool) -> Result<MaxicodeDetectionRe
let [tl, bl, tr, br] = symbol_box.0;
let target_width = Point::distance(tl.into(), tr.into());
let target_height = Point::distance(br.into(), tr.into());
let target_width = Point::distance(tl, tr);
let target_height = Point::distance(br, tr);
// let target_width = (tr.0 - tl.0).round().abs() as u32;
// let target_height = (br.1 - tr.1).round().abs() as u32;
@@ -376,11 +376,7 @@ pub fn detect(image: &BitMatrix, try_harder: bool) -> Result<MaxicodeDetectionRe
return Ok(MaxicodeDetectionResult {
bits,
points: symbol_box
.0
.iter()
// .map(|p| Point { x: p.x, y: p.y })
.copied()
.collect(),
.0.to_vec(),
rotation: symbol_box.1,
});
}

View File

@@ -132,7 +132,7 @@ impl RXingResult {
/** Currently necessary because the external OneDReader proc macro uses it. */
pub fn getRXingResultPoints(&self) -> &Vec<Point> {
&&self.resultPoints
&self.resultPoints
}
/** Currently necessary because the external OneDReader proc macro uses it. */