diff --git a/src/common/cpp_essentials/concentric_finder.rs b/src/common/cpp_essentials/concentric_finder.rs index 0df0c69..c0479c6 100644 --- a/src/common/cpp_essentials/concentric_finder.rs +++ b/src/common/cpp_essentials/concentric_finder.rs @@ -412,7 +412,12 @@ pub fn FitQadrilateralToPoints(center: Point, points: &mut [Point]) -> Option Matrix { pub fn get(&self, x: usize, y: usize) -> Option { if x >= self.width || y >= self.height { None - } else if let Some(Some(d)) = self.data.get(Self::get_offset(x, y, self.width)){ + } else if let Some(Some(d)) = self.data.get(Self::get_offset(x, y, self.width)) { Some(*d) - }else { + } else { None } } diff --git a/src/common/cpp_essentials/pattern.rs b/src/common/cpp_essentials/pattern.rs index b5bd65d..6fcd9c2 100644 --- a/src/common/cpp_essentials/pattern.rs +++ b/src/common/cpp_essentials/pattern.rs @@ -163,7 +163,7 @@ impl<'a> PatternView<'a> { // index is the number of bars and spaces from the first bar to the current position pub fn index(&self) -> usize { - self.current - self.start /*return narrow_cast(_data - _base) - 1;*/ + self.current /*return narrow_cast(_data - _base) - 1;*/ } pub fn pixelsInFront(&self) -> PatternType { self.data diff --git a/src/qrcode/cpp_port/detector.rs b/src/qrcode/cpp_port/detector.rs index c5ffb52..6bbead9 100644 --- a/src/qrcode/cpp_port/detector.rs +++ b/src/qrcode/cpp_port/detector.rs @@ -715,7 +715,10 @@ pub fn SampleQR(image: &BitMatrix, fp: &FinderPatternSet) -> Result Self { Self { x: self.x.floor(), - y: self.y.floor() + y: self.y.floor(), } } }