mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
fix small clippy issue and bump version
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rxing"
|
name = "rxing"
|
||||||
version = "0.2.12"
|
version = "0.2.13"
|
||||||
description="A rust port of the zxing barcode library."
|
description="A rust port of the zxing barcode library."
|
||||||
license="Apache-2.0"
|
license="Apache-2.0"
|
||||||
repository="https://github.com/hschimke/rxing"
|
repository="https://github.com/hschimke/rxing"
|
||||||
|
|||||||
@@ -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_value = if value.get(x, y) { u8::MIN } else { u8::MAX };
|
||||||
let pixel_intrior = [pixel_value, pixel_value, pixel_value];
|
let pixel_intrior = [pixel_value, pixel_value, pixel_value];
|
||||||
let pixel = image::Rgb(pixel_intrior);
|
let pixel = image::Rgb(pixel_intrior);
|
||||||
pixels.put_pixel(
|
pixels.put_pixel(x, y, pixel);
|
||||||
x,
|
|
||||||
y,
|
|
||||||
pixel,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pixels.into()
|
pixels.into()
|
||||||
|
|||||||
@@ -616,14 +616,17 @@ fn getStartColumn(
|
|||||||
|
|
||||||
while isValidBarcodeColumn(detectionRXingResult, (barcodeColumn - offset) as usize) {
|
while isValidBarcodeColumn(detectionRXingResult, (barcodeColumn - offset) as usize) {
|
||||||
barcodeColumn -= offset;
|
barcodeColumn -= offset;
|
||||||
for previousRowCodeword in detectionRXingResult
|
if let Some(previousRowCodeword) = detectionRXingResult
|
||||||
.getDetectionRXingResultColumn(barcodeColumn as usize)
|
.getDetectionRXingResultColumn(barcodeColumn as usize)
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.getCodewords()
|
.getCodewords()
|
||||||
|
.iter()
|
||||||
|
.flatten()
|
||||||
|
.next()
|
||||||
{
|
{
|
||||||
// for (Codeword previousRowCodeword : detectionRXingResult.getDetectionRXingResultColumn(barcodeColumn).getCodewords()) {
|
// for (Codeword previousRowCodeword : detectionRXingResult.getDetectionRXingResultColumn(barcodeColumn).getCodewords()) {
|
||||||
if let Some(previousRowCodeword) = previousRowCodeword {
|
// if let Some(previousRowCodeword) = previousRowCodeword {
|
||||||
// if previousRowCodeword.is_some() {
|
// if previousRowCodeword.is_some() {
|
||||||
return ((if leftToRight {
|
return ((if leftToRight {
|
||||||
previousRowCodeword.getEndX()
|
previousRowCodeword.getEndX()
|
||||||
@@ -632,9 +635,9 @@ fn getStartColumn(
|
|||||||
}) as isize
|
}) as isize
|
||||||
+ offset
|
+ offset
|
||||||
* skippedColumns as isize
|
* skippedColumns as isize
|
||||||
* (previousRowCodeword.getEndX() - previousRowCodeword.getStartX())
|
* (previousRowCodeword.getEndX() - previousRowCodeword.getStartX()) as isize)
|
||||||
as isize) as u32;
|
as u32;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
skippedColumns += 1;
|
skippedColumns += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,11 @@ fn correctErrors(codewordBytes: &mut [u8], numDataCodewords: usize) -> Result<()
|
|||||||
|
|
||||||
// Copy back into array of bytes -- only need to worry about the bytes that were data
|
// 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
|
// 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){
|
for (code_word, sent_code_word) in codewordBytes
|
||||||
|
.iter_mut()
|
||||||
|
.zip(sending_code_words.iter())
|
||||||
|
.take(numDataCodewords)
|
||||||
|
{
|
||||||
*code_word = *sent_code_word as u8;
|
*code_word = *sent_code_word as u8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user