mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
refactor to use exception helper factories
This commit is contained in:
@@ -19,7 +19,7 @@ impl OtsuLevelBinarizer {
|
||||
fn generate_threshold_matrix(source: &dyn LuminanceSource) -> Result<BitMatrix, Exceptions> {
|
||||
let image_buffer = {
|
||||
let Some(buff) : Option<ImageBuffer<Luma<u8>,Vec<u8>>> = ImageBuffer::from_vec(source.getWidth() as u32, source.getHeight() as u32, source.getMatrix()) else {
|
||||
return Err(Exceptions::IllegalArgumentException(None))
|
||||
return Err(Exceptions::illegalArgumentEmpty())
|
||||
};
|
||||
buff
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user