refactor to use common result type

This commit is contained in:
Vukašin Stepanović
2023-02-14 22:56:03 +00:00
parent 145cf704fe
commit 8ee616d96b
160 changed files with 829 additions and 901 deletions

View File

@@ -15,8 +15,8 @@
*/
use crate::{
common::BitMatrix, BinaryBitmap, DecodingHintDictionary, Exceptions, RXingResultPoint,
ResultPoint,
common::{BitMatrix, Result},
BinaryBitmap, DecodingHintDictionary, Exceptions, RXingResultPoint, ResultPoint,
};
use std::borrow::Cow;
@@ -68,7 +68,7 @@ pub fn detect_with_hints(
image: &mut BinaryBitmap,
_hints: &DecodingHintDictionary,
multiple: bool,
) -> Result<PDF417DetectorRXingResult, Exceptions> {
) -> Result<PDF417DetectorRXingResult> {
// TODO detection improvement, tryHarder could try several different luminance thresholds/blackpoints or even
// different binarizers
//boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);
@@ -101,7 +101,7 @@ pub fn detect_with_hints(
* @param rotation the degrees of rotation to apply
* @return BitMatrix with applied rotation
*/
fn applyRotation(matrix: &BitMatrix, rotation: u32) -> Result<Cow<BitMatrix>, Exceptions> {
fn applyRotation(matrix: &BitMatrix, rotation: u32) -> Result<Cow<BitMatrix>> {
if rotation % 360 == 0 {
Ok(Cow::Borrowed(matrix))
} else {