remove ResultPoint trait uses of Point

Point already has `x` and `y` properties, so accessing
them with `getX()` and `getY()` is needlessly verbose.
These calls have been removed, though the trait impl is
still presen for the time being, since the OneDReader
proc macro requires it.
This commit is contained in:
Vukašin Stepanović
2023-02-16 15:54:07 +00:00
parent 9889555b02
commit 0992e85e6c
16 changed files with 137 additions and 147 deletions

View File

@@ -17,7 +17,7 @@
use crate::{
common::{BitArray, Result},
point, BinaryBitmap, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
RXingResult, RXingResultMetadataType, RXingResultMetadataValue, Reader, ResultPoint,
RXingResult, RXingResultMetadataType, RXingResultMetadataValue, Reader,
};
/**
@@ -117,8 +117,8 @@ pub trait OneDReader: Reader {
// And remember to flip the result points horizontally.
let points = result.getPointsMut();
if !points.is_empty() && points.len() >= 2 {
points[0] = point(width as f32 - points[0].getX() - 1.0, points[0].getY());
points[1] = point(width as f32 - points[1].getX() - 1.0, points[1].getY());
points[0] = point(width as f32 - points[0].x - 1.0, points[0].y);
points[1] = point(width as f32 - points[1].x - 1.0, points[1].y);
}
}
return Ok(result);