Merge branch 'main' into pr/exception_helpers

This commit is contained in:
Vukašin Stepanović
2023-02-16 07:15:51 +00:00
161 changed files with 900 additions and 933 deletions

View File

@@ -16,7 +16,10 @@
use std::rc::Rc;
use crate::{common::BitMatrix, Exceptions, RXingResultPoint, ResultPoint};
use crate::{
common::{BitMatrix, Result},
Exceptions, RXingResultPoint, ResultPoint,
};
/**
* @author Guenther Grau
@@ -40,7 +43,7 @@ impl BoundingBox {
bottomLeft: Option<RXingResultPoint>,
topRight: Option<RXingResultPoint>,
bottomRight: Option<RXingResultPoint>,
) -> Result<BoundingBox, Exceptions> {
) -> Result<BoundingBox> {
let leftUnspecified = topLeft.is_none() || bottomLeft.is_none();
let rightUnspecified = topRight.is_none() || bottomRight.is_none();
if leftUnspecified && rightUnspecified {
@@ -100,7 +103,7 @@ impl BoundingBox {
pub fn merge(
leftBox: Option<BoundingBox>,
rightBox: Option<BoundingBox>,
) -> Result<BoundingBox, Exceptions> {
) -> Result<BoundingBox> {
if leftBox.is_none() {
return Ok(rightBox.as_ref().ok_or(Exceptions::illegalState)?.clone());
}
@@ -124,7 +127,7 @@ impl BoundingBox {
missingStartRows: u32,
missingEndRows: u32,
isLeft: bool,
) -> Result<BoundingBox, Exceptions> {
) -> Result<BoundingBox> {
let mut newTopLeft = self.topLeft;
let mut newBottomLeft = self.bottomLeft;
let mut newTopRight = self.topRight;