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:
|
||||
let mut row = if let Ok(res) = image.getBlackRow(rowNumber as usize) {
|
||||
res.into_owned()
|
||||
res
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
@@ -97,7 +97,7 @@ pub trait OneDReader: Reader {
|
||||
// for (int attempt = 0; attempt < 2; attempt++) {
|
||||
if attempt == 1 {
|
||||
// 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
|
||||
// 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
|
||||
|
||||
@@ -76,6 +76,7 @@ fn testDecodingRowByRow() {
|
||||
.getBlackRow(secondRowNumber)
|
||||
.expect("get row")
|
||||
.into_owned();
|
||||
|
||||
secondRow.reverse();
|
||||
|
||||
let totalPairs = rssExpandedReader
|
||||
|
||||
Reference in New Issue
Block a user