fix some use of Cow results from getBlackRow

This commit is contained in:
Henry Schimke
2023-01-05 11:59:54 -06:00
parent 6c0db8b7d2
commit f425b89510
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -76,6 +76,7 @@ fn testDecodingRowByRow() {
.getBlackRow(secondRowNumber)
.expect("get row")
.into_owned();
secondRow.reverse();
let totalPairs = rssExpandedReader