cargo fmt

This commit is contained in:
Vukašin Stepanović
2023-02-16 08:40:57 +00:00
parent 05e377e85b
commit 844ffc3b81
28 changed files with 80 additions and 156 deletions

View File

@@ -64,8 +64,7 @@ impl BoundingBox {
newTopLeft = topLeft.ok_or(Exceptions::IllegalStateException(None))?;
newBottomLeft = bottomLeft.ok_or(Exceptions::IllegalStateException(None))?;
newTopRight = Point::new(image.getWidth() as f32 - 1.0, newTopLeft.getY());
newBottomRight =
Point::new(image.getWidth() as f32 - 1.0, newBottomLeft.getY());
newBottomRight = Point::new(image.getWidth() as f32 - 1.0, newBottomLeft.getY());
} else {
newTopLeft = topLeft.ok_or(Exceptions::IllegalStateException(None))?;
newTopRight = topRight.ok_or(Exceptions::IllegalStateException(None))?;

View File

@@ -179,11 +179,7 @@ pub fn detect(multiple: bool, bitMatrix: &BitMatrix) -> Option<Vec<[Option<Point
* vertices[6] x, y top right codeword area
* vertices[7] x, y bottom right codeword area
*/
fn findVertices(
matrix: &BitMatrix,
startRow: u32,
startColumn: u32,
) -> Option<[Option<Point>; 8]> {
fn findVertices(matrix: &BitMatrix, startRow: u32, startColumn: u32) -> Option<[Option<Point>; 8]> {
let height = matrix.getHeight();
let width = matrix.getWidth();
let mut startRow = startRow;
@@ -249,14 +245,8 @@ fn findRowsWithPattern(
break;
}
}
result[0] = Some(Point::new(
loc_store.as_ref()?[0] as f32,
startRow as f32,
));
result[1] = Some(Point::new(
loc_store.as_ref()?[1] as f32,
startRow as f32,
));
result[0] = Some(Point::new(loc_store.as_ref()?[0] as f32, startRow as f32));
result[1] = Some(Point::new(loc_store.as_ref()?[1] as f32, startRow as f32));
found = true;
break;
}
@@ -304,14 +294,8 @@ fn findRowsWithPattern(
stopRow += 1;
}
stopRow -= skippedRowCount + 1;
result[2] = Some(Point::new(
previousRowLoc[0] as f32,
stopRow as f32,
));
result[3] = Some(Point::new(
previousRowLoc[1] as f32,
stopRow as f32,
));
result[2] = Some(Point::new(previousRowLoc[0] as f32, stopRow as f32));
result[3] = Some(Point::new(previousRowLoc[1] as f32, stopRow as f32));
}
if stopRow - startRow < BARCODE_MIN_HEIGHT {
result.fill(None);

View File

@@ -26,11 +26,7 @@ pub struct PDF417DetectorRXingResult {
}
impl PDF417DetectorRXingResult {
pub fn with_rotation(
bits: BitMatrix,
points: Vec<[Option<Point>; 8]>,
rotation: u32,
) -> Self {
pub fn with_rotation(bits: BitMatrix, points: Vec<[Option<Point>; 8]>, rotation: u32) -> Self {
Self {
bits,
points,

View File

@@ -18,8 +18,8 @@ use std::collections::HashMap;
use crate::{
common::Result, multi::MultipleBarcodeReader, BarcodeFormat, BinaryBitmap,
DecodingHintDictionary, Exceptions, RXingResult, RXingResultMetadataType,
RXingResultMetadataValue, Point, Reader, ResultPoint,
DecodingHintDictionary, Exceptions, Point, RXingResult, RXingResultMetadataType,
RXingResultMetadataValue, Reader, ResultPoint,
};
use super::{