mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
cargo clippy --fix
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user