mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
Use thiserror for error handling with less boilerplate
This commit is contained in:
@@ -167,7 +167,7 @@ impl PlanarYUVLuminanceSource {
|
||||
inverted: bool,
|
||||
) -> Result<Self> {
|
||||
if left + width > data_width || top + height > data_height {
|
||||
return Err(Exceptions::illegalArgumentWith(
|
||||
return Err(Exceptions::illegal_argument_with(
|
||||
"Crop rectangle does not fit within image data.",
|
||||
));
|
||||
}
|
||||
@@ -329,7 +329,7 @@ impl LuminanceSource for PlanarYUVLuminanceSource {
|
||||
self.invert,
|
||||
) {
|
||||
Ok(new) => Ok(Box::new(new)),
|
||||
Err(_err) => Err(Exceptions::unsupportedOperation),
|
||||
Err(_err) => Err(Exceptions::UNSUPPORTED_OPERATION),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user