add point(x: f32, y: f32) function

Shorter than writing `Point::new`
This commit is contained in:
Vukašin Stepanović
2023-02-16 11:20:03 +00:00
parent 868a9b26de
commit 39b4866e47
22 changed files with 113 additions and 109 deletions

View File

@@ -17,7 +17,7 @@
use std::collections::HashMap;
use crate::common::Result;
use crate::{Exceptions, Point, RXingResult, Reader, ResultPoint};
use crate::{point, Exceptions, Point, RXingResult, Reader, ResultPoint};
/**
* This class attempts to decode a barcode from an image, not by scanning the whole image,
@@ -124,7 +124,7 @@ impl<T: Reader> ByQuadrantReader<T> {
// if !points.is_empty() {
// // for relative in points {
// // result.push(Point::new(
// // result.push(point(
// // relative.getX() + leftOffset,
// // relative.getY() + topOffset,
// // ));
@@ -133,7 +133,7 @@ impl<T: Reader> ByQuadrantReader<T> {
// result
points
.iter()
.map(|relative| Point::new(relative.getX() + leftOffset, relative.getY() + topOffset))
.map(|relative| point(relative.getX() + leftOffset, relative.getY() + topOffset))
.collect()
}
}