fix small clippy issue and bump version

This commit is contained in:
Henry Schimke
2023-01-10 09:55:19 -06:00
parent 149dc260c9
commit 752d8c87b9
4 changed files with 25 additions and 22 deletions

View File

@@ -680,11 +680,7 @@ impl From<&BitMatrix> for image::DynamicImage {
let pixel_value = if value.get(x, y) { u8::MIN } else { u8::MAX };
let pixel_intrior = [pixel_value, pixel_value, pixel_value];
let pixel = image::Rgb(pixel_intrior);
pixels.put_pixel(
x,
y,
pixel,
);
pixels.put_pixel(x, y, pixel);
}
}
pixels.into()

View File

@@ -616,25 +616,28 @@ fn getStartColumn(
while isValidBarcodeColumn(detectionRXingResult, (barcodeColumn - offset) as usize) {
barcodeColumn -= offset;
for previousRowCodeword in detectionRXingResult
if let Some(previousRowCodeword) = detectionRXingResult
.getDetectionRXingResultColumn(barcodeColumn as usize)
.as_ref()
.unwrap()
.getCodewords()
.iter()
.flatten()
.next()
{
// for (Codeword previousRowCodeword : detectionRXingResult.getDetectionRXingResultColumn(barcodeColumn).getCodewords()) {
if let Some(previousRowCodeword) = previousRowCodeword {
// if previousRowCodeword.is_some() {
return ((if leftToRight {
previousRowCodeword.getEndX()
} else {
previousRowCodeword.getStartX()
}) as isize
+ offset
* skippedColumns as isize
* (previousRowCodeword.getEndX() - previousRowCodeword.getStartX())
as isize) as u32;
}
// if let Some(previousRowCodeword) = previousRowCodeword {
// if previousRowCodeword.is_some() {
return ((if leftToRight {
previousRowCodeword.getEndX()
} else {
previousRowCodeword.getStartX()
}) as isize
+ offset
* skippedColumns as isize
* (previousRowCodeword.getEndX() - previousRowCodeword.getStartX()) as isize)
as u32;
// }
}
skippedColumns += 1;
}

View File

@@ -215,9 +215,13 @@ fn correctErrors(codewordBytes: &mut [u8], numDataCodewords: usize) -> Result<()
// Copy back into array of bytes -- only need to worry about the bytes that were data
// We don't care about errors in the error-correction codewords
for (code_word, sent_code_word ) in codewordBytes.iter_mut().zip(sending_code_words.iter()).take(numDataCodewords){
*code_word = *sent_code_word as u8;
for (code_word, sent_code_word) in codewordBytes
.iter_mut()
.zip(sending_code_words.iter())
.take(numDataCodewords)
{
*code_word = *sent_code_word as u8;
}
Ok(())
}