chore: cargo fmt

This commit is contained in:
Henry Schimke
2024-01-13 18:12:23 -06:00
parent c9e10ea9ca
commit 6faf506398
6 changed files with 71 additions and 56 deletions

View File

@@ -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], &[])

View File

@@ -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
}
}