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

@@ -18,6 +18,7 @@ use std::collections::HashMap;
use crate::{
aztec::AztecWriter,
common::Result,
datamatrix::DataMatrixWriter,
oned::{
CodaBarWriter, Code128Writer, Code39Writer, Code93Writer, EAN13Writer, EAN8Writer,
@@ -44,7 +45,7 @@ impl Writer for MultiFormatWriter {
format: &crate::BarcodeFormat,
width: i32,
height: i32,
) -> Result<crate::common::BitMatrix, crate::Exceptions> {
) -> Result<crate::common::BitMatrix> {
self.encode_with_hints(contents, format, width, height, &HashMap::new())
}
@@ -55,7 +56,7 @@ impl Writer for MultiFormatWriter {
width: i32,
height: i32,
hints: &crate::EncodingHintDictionary,
) -> Result<crate::common::BitMatrix, crate::Exceptions> {
) -> Result<crate::common::BitMatrix> {
let writer: Box<dyn Writer> = match format {
BarcodeFormat::EAN_8 => Box::<EAN8Writer>::default(),
BarcodeFormat::UPC_E => Box::<UPCEWriter>::default(),