cargo fmt

This commit is contained in:
Henry Schimke
2022-12-29 17:58:52 -06:00
parent ed0dcefa79
commit a513b8c638
2 changed files with 7 additions and 3 deletions

View File

@@ -203,9 +203,11 @@ impl BitMatrix {
return ((self.bits[offset] >> (x & 0x1f)) & 1) != 0;
}
pub fn try_get(&self, x: u32, y: u32) -> Result<bool,Exceptions> {
pub fn try_get(&self, x: u32, y: u32) -> Result<bool, Exceptions> {
let offset = y as usize * self.row_size + (x as usize / 32);
if offset > self.bits.len() { return Err(Exceptions::IndexOutOfBoundsException("".to_owned()))}
if offset > self.bits.len() {
return Err(Exceptions::IndexOutOfBoundsException("".to_owned()));
}
return Ok(((self.bits[offset] >> (x & 0x1f)) & 1) != 0);
}

View File

@@ -817,7 +817,9 @@ fn adjustCodewordStartColumn(
return codewordStartColumn;
}
correctedStartColumn = (correctedStartColumn as i32 + increment) as u32;
if let Err(_) = image.try_get(correctedStartColumn, imageRow){return 0}
if let Err(_) = image.try_get(correctedStartColumn, imageRow) {
return 0;
}
}
increment = -increment;
leftToRight = !leftToRight;