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

@@ -16,7 +16,10 @@
use unicode_segmentation::UnicodeSegmentation;
use crate::{common::DecoderRXingResult, Exceptions};
use crate::{
common::{DecoderRXingResult, Result},
Exceptions,
};
use once_cell::sync::Lazy;
/**
@@ -78,7 +81,7 @@ static SETS: Lazy<[String; 5]> = Lazy::new(|| {
]
});
pub fn decode(bytes: &[u8], mode: u8) -> Result<DecoderRXingResult, Exceptions> {
pub fn decode(bytes: &[u8], mode: u8) -> Result<DecoderRXingResult> {
let mut result = String::with_capacity(144);
match mode {
2 | 3 => {