mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
refactor to use exception helper factories
This commit is contained in:
@@ -127,9 +127,7 @@ impl<'a> Detector<'_> {
|
||||
|| !self.is_valid(&bulls_eye_corners[2])
|
||||
|| !self.is_valid(&bulls_eye_corners[3])
|
||||
{
|
||||
return Err(Exceptions::NotFoundException(Some(
|
||||
"no valid points".to_owned(),
|
||||
)));
|
||||
return Err(Exceptions::notFound("no valid points".to_owned()));
|
||||
}
|
||||
let length = 2 * self.nb_center_layers;
|
||||
// Get the bits around the bull's eye
|
||||
@@ -210,9 +208,7 @@ impl<'a> Detector<'_> {
|
||||
return Ok(shift);
|
||||
}
|
||||
}
|
||||
Err(Exceptions::NotFoundException(Some(
|
||||
"rotation failure".to_owned(),
|
||||
)))
|
||||
Err(Exceptions::notFound("rotation failure".to_owned()))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,7 +320,7 @@ impl<'a> Detector<'_> {
|
||||
}
|
||||
|
||||
if self.nb_center_layers != 5 && self.nb_center_layers != 7 {
|
||||
return Err(Exceptions::NotFoundException(None));
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
}
|
||||
|
||||
self.compact = self.nb_center_layers == 5;
|
||||
|
||||
Reference in New Issue
Block a user