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: // 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

View File

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