mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Use thiserror for error handling with less boilerplate
This commit is contained in:
@@ -92,9 +92,9 @@ pub trait LuminanceSource {
|
||||
_width: usize,
|
||||
_height: usize,
|
||||
) -> Result<Box<dyn LuminanceSource>> {
|
||||
Err(Exceptions::UnsupportedOperationException(Some(
|
||||
"This luminance source does not support cropping.".to_owned(),
|
||||
)))
|
||||
Err(Exceptions::unsupported_operation_with(
|
||||
"This luminance source does not support cropping.",
|
||||
))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,9 +119,9 @@ pub trait LuminanceSource {
|
||||
* @return A rotated version of this object.
|
||||
*/
|
||||
fn rotateCounterClockwise(&self) -> Result<Box<dyn LuminanceSource>> {
|
||||
Err(Exceptions::UnsupportedOperationException(Some(
|
||||
"This luminance source does not support rotation by 90 degrees.".to_owned(),
|
||||
)))
|
||||
Err(Exceptions::unsupported_operation_with(
|
||||
"This luminance source does not support rotation by 90 degrees.",
|
||||
))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,9 +131,9 @@ pub trait LuminanceSource {
|
||||
* @return A rotated version of this object.
|
||||
*/
|
||||
fn rotateCounterClockwise45(&self) -> Result<Box<dyn LuminanceSource>> {
|
||||
Err(Exceptions::UnsupportedOperationException(Some(
|
||||
"This luminance source does not support rotation by 45 degrees.".to_owned(),
|
||||
)))
|
||||
Err(Exceptions::unsupported_operation_with(
|
||||
"This luminance source does not support rotation by 45 degrees.",
|
||||
))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user