mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 20:32:34 +00:00
Use thiserror for error handling with less boilerplate
This commit is contained in:
@@ -146,7 +146,7 @@ pub trait GridSampler {
|
||||
let x = points[offset] as i32;
|
||||
let y = points[offset + 1] as i32;
|
||||
if x < -1 || x > width as i32 || y < -1 || y > height as i32 {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
nudged = false;
|
||||
if x == -1 {
|
||||
@@ -173,7 +173,7 @@ pub trait GridSampler {
|
||||
let x = points[offset as usize] as i32;
|
||||
let y = points[offset as usize + 1] as i32;
|
||||
if x < -1 || x > width as i32 || y < -1 || y > height as i32 {
|
||||
return Err(Exceptions::notFound);
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
}
|
||||
nudged = false;
|
||||
if x == -1 {
|
||||
|
||||
Reference in New Issue
Block a user