mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 04:42:35 +00:00
refactor to use exception helper factories
This commit is contained in:
@@ -133,7 +133,7 @@ impl GenericGF {
|
||||
*/
|
||||
pub fn log(&self, a: i32) -> Result<i32, Exceptions> {
|
||||
if a == 0 {
|
||||
return Err(Exceptions::IllegalArgumentException(None));
|
||||
return Err(Exceptions::illegalArgumentEmpty());
|
||||
}
|
||||
// let pos: usize = a.try_into().unwrap();
|
||||
Ok(self.logTable[a as usize])
|
||||
@@ -144,7 +144,7 @@ impl GenericGF {
|
||||
*/
|
||||
pub fn inverse(&self, a: i32) -> Result<i32, Exceptions> {
|
||||
if a == 0 {
|
||||
return Err(Exceptions::ArithmeticException(None));
|
||||
return Err(Exceptions::arithmeticEmpty());
|
||||
}
|
||||
let log_t_loc: usize = a as usize;
|
||||
let loc: usize = ((self.size as i32) - self.logTable[log_t_loc] - 1) as usize;
|
||||
|
||||
Reference in New Issue
Block a user