mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
Use thiserror for error handling with less boilerplate
This commit is contained in:
@@ -123,10 +123,10 @@ impl MaxiCodeReader {
|
||||
fn extractPureBits(image: &BitMatrix) -> Result<BitMatrix> {
|
||||
let enclosingRectangleOption = image.getEnclosingRectangle();
|
||||
if enclosingRectangleOption.is_none() {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
|
||||
let enclosingRectangle = enclosingRectangleOption.ok_or(Exceptions::notFound)?;
|
||||
let enclosingRectangle = enclosingRectangleOption.ok_or(Exceptions::NOT_FOUND)?;
|
||||
|
||||
let left = enclosingRectangle[0];
|
||||
let top = enclosingRectangle[1];
|
||||
|
||||
Reference in New Issue
Block a user