mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
fix some use of Cow results from getBlackRow
This commit is contained in:
@@ -81,7 +81,7 @@ pub trait OneDReader: Reader {
|
|||||||
|
|
||||||
// Estimate black point for this row and load it:
|
// Estimate black point for this row and load it:
|
||||||
let mut row = if let Ok(res) = image.getBlackRow(rowNumber as usize) {
|
let mut row = if let Ok(res) = image.getBlackRow(rowNumber as usize) {
|
||||||
res.into_owned()
|
res
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
@@ -97,7 +97,7 @@ pub trait OneDReader: Reader {
|
|||||||
// for (int attempt = 0; attempt < 2; attempt++) {
|
// for (int attempt = 0; attempt < 2; attempt++) {
|
||||||
if attempt == 1 {
|
if attempt == 1 {
|
||||||
// trying again?
|
// trying again?
|
||||||
row.reverse(); // reverse the row and continue
|
row.to_mut().reverse(); // reverse the row and continue
|
||||||
// This means we will only ever draw result points *once* in the life of this method
|
// This means we will only ever draw result points *once* in the life of this method
|
||||||
// since we want to avoid drawing the wrong points after flipping the row, and,
|
// since we want to avoid drawing the wrong points after flipping the row, and,
|
||||||
// don't want to clutter with noise from every single row scan -- just the scans
|
// don't want to clutter with noise from every single row scan -- just the scans
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ fn testDecodingRowByRow() {
|
|||||||
.getBlackRow(secondRowNumber)
|
.getBlackRow(secondRowNumber)
|
||||||
.expect("get row")
|
.expect("get row")
|
||||||
.into_owned();
|
.into_owned();
|
||||||
|
|
||||||
secondRow.reverse();
|
secondRow.reverse();
|
||||||
|
|
||||||
let totalPairs = rssExpandedReader
|
let totalPairs = rssExpandedReader
|
||||||
|
|||||||
Reference in New Issue
Block a user