mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
chore: cargo fmt
This commit is contained in:
@@ -102,12 +102,9 @@ impl FormatInformation {
|
||||
*/
|
||||
pub fn DecodeRMQR(formatInfoBits1: u32, formatInfoBits2: u32) -> Self {
|
||||
//FormatInformation fi;
|
||||
|
||||
|
||||
let mut fi = if formatInfoBits2 != 0 {
|
||||
Self::FindBestFormatInfoRMQR(
|
||||
&[formatInfoBits1],
|
||||
&[formatInfoBits2],
|
||||
)
|
||||
Self::FindBestFormatInfoRMQR(&[formatInfoBits1], &[formatInfoBits2])
|
||||
} else {
|
||||
// TODO probably remove if `sampleRMQR()` done properly
|
||||
Self::FindBestFormatInfoRMQR(&[formatInfoBits1], &[])
|
||||
|
||||
@@ -144,7 +144,7 @@ impl Version {
|
||||
Type::const_eq(self.qr_type, Type::RectMicro)
|
||||
}
|
||||
|
||||
pub fn SymbolSize(version: u32, qr_type: Type) -> PointI {
|
||||
pub fn SymbolSize(version: u32, qr_type: Type) -> PointI {
|
||||
let version = version as i32;
|
||||
|
||||
let square = |s: i32| point(s, s);
|
||||
@@ -216,7 +216,8 @@ impl Version {
|
||||
fn IndexOf(_points: &[PointI], search: PointI) -> i32 {
|
||||
RMQR_SIZES
|
||||
.iter()
|
||||
.position(|p| *p == search).map(|x| x as i32)
|
||||
.position(|p| *p == search)
|
||||
.map(|x| x as i32)
|
||||
.unwrap_or(-1)
|
||||
}
|
||||
|
||||
@@ -224,11 +225,11 @@ impl Version {
|
||||
if size.x != size.y {
|
||||
(Self::IndexOf(&RMQR_SIZES, size) + 1) as u32
|
||||
} else if Self::IsValidSize(size, Type::Model2) {
|
||||
((size.x - 17) / 4) as u32
|
||||
((size.x - 17) / 4) as u32
|
||||
} else if Self::IsValidSize(size, Type::Micro) {
|
||||
((size.x - 9) / 2) as u32
|
||||
((size.x - 9) / 2) as u32
|
||||
} else {
|
||||
0
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user