mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
add aliases so the OneDReader proc macro compiles
Currently it's not possible to rename RXingResultPoint to Point cleanly, since the external OneDReader proc macro makes use of them. For the time being, simple aliases are introduced to get the code to compile, but the plan is to remove them at a later point.
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
use rxing_one_d_proc_derive::OneDReader;
|
use rxing_one_d_proc_derive::OneDReader;
|
||||||
|
|
||||||
use crate::common::{BitArray, Result};
|
use crate::common::{BitArray, Result};
|
||||||
use crate::BarcodeFormat;
|
use crate::{BarcodeFormat, Point};
|
||||||
use crate::DecodeHintValue;
|
use crate::DecodeHintValue;
|
||||||
use crate::Exceptions;
|
use crate::Exceptions;
|
||||||
use crate::RXingResult;
|
use crate::RXingResult;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use rxing_one_d_proc_derive::OneDReader;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{BitArray, Result},
|
common::{BitArray, Result},
|
||||||
BarcodeFormat, Exceptions, RXingResult,
|
BarcodeFormat, Exceptions, RXingResult, Point,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{one_d_reader, OneDReader};
|
use super::{one_d_reader, OneDReader};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
use rxing_one_d_proc_derive::OneDReader;
|
use rxing_one_d_proc_derive::OneDReader;
|
||||||
|
|
||||||
use crate::common::{BitArray, Result};
|
use crate::common::{BitArray, Result};
|
||||||
use crate::{BarcodeFormat, Exceptions, RXingResult};
|
use crate::{BarcodeFormat, Exceptions, RXingResult, Point};
|
||||||
|
|
||||||
use super::{one_d_reader, OneDReader};
|
use super::{one_d_reader, OneDReader};
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use rxing_one_d_proc_derive::OneDReader;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{BitArray, Result},
|
common::{BitArray, Result},
|
||||||
BarcodeFormat, Exceptions, RXingResult,
|
BarcodeFormat, Exceptions, RXingResult, Point,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{one_d_reader, OneDReader};
|
use super::{one_d_reader, OneDReader};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use rxing_one_d_proc_derive::OneDReader;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{BitArray, Result},
|
common::{BitArray, Result},
|
||||||
BarcodeFormat, DecodeHintValue, Exceptions, RXingResult,
|
BarcodeFormat, DecodeHintValue, Exceptions, RXingResult, Point,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{one_d_reader, OneDReader};
|
use super::{one_d_reader, OneDReader};
|
||||||
|
|||||||
@@ -130,6 +130,16 @@ impl RXingResult {
|
|||||||
&mut self.resultPoints
|
&mut self.resultPoints
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Currently necessary because the external OneDReader proc macro uses it. */
|
||||||
|
pub fn getRXingResultPoints(&self) -> &Vec<Point> {
|
||||||
|
&&self.resultPoints
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Currently necessary because the external OneDReader proc macro uses it. */
|
||||||
|
pub fn getRXingResultPointsMut(&mut self) -> &mut Vec<Point> {
|
||||||
|
&mut self.resultPoints
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@link BarcodeFormat} representing the format of the barcode that was decoded
|
* @return {@link BarcodeFormat} representing the format of the barcode that was decoded
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ pub struct Point {
|
|||||||
pub(crate) y: f32,
|
pub(crate) y: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Currently necessary because the external OneDReader proc macro uses it. */
|
||||||
|
pub type RXingResultPoint = Point;
|
||||||
|
|
||||||
impl Hash for Point {
|
impl Hash for Point {
|
||||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||||
self.x.to_string().hash(state);
|
self.x.to_string().hash(state);
|
||||||
|
|||||||
Reference in New Issue
Block a user