Skip to content

Commit 0b08b3a

Browse files
committed
Merge branch 'main' of github.com:hschimke/rxing
2 parents 5a9bcfc + 7d8e519 commit 0b08b3a

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/pdf417/decoder/pdf_417_scanning_decoder.rs

+16-18
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,21 @@ fn getBarcodeMetadata<T: DetectionRXingResultRowIndicatorColumn>(
290290
// return if rightRowIndicatorColumn.is_none() {None} else {rightRowIndicatorColumn.getBarcodeMetadata()};
291291
// }
292292

293-
let rightBarcodeMetadata = if rightRowIndicatorColumn.is_none()
294-
|| rightRowIndicatorColumn
295-
.as_mut()
296-
.unwrap()
297-
.getBarcodeMetadata()
298-
.is_none()
299-
{
293+
let rightBarcodeMetadata = if rightRowIndicatorColumn.is_none() {
300294
return leftBarcodeMetadata;
295+
} else if let Some(mdt) = rightRowIndicatorColumn
296+
.as_mut()
297+
.unwrap()
298+
.getBarcodeMetadata()
299+
{
300+
mdt
301+
// rightRowIndicatorColumn
302+
// .as_mut()
303+
// .unwrap()
304+
// .getBarcodeMetadata()
305+
// .unwrap()
301306
} else {
302-
rightRowIndicatorColumn
303-
.as_mut()
304-
.unwrap()
305-
.getBarcodeMetadata()
307+
return leftBarcodeMetadata;
306308
};
307309
// if rightRowIndicatorColumn.is_none() ||
308310
// (rightBarcodeMetadata = rightRowIndicatorColumn.getBarcodeMetadata()).is_none() {
@@ -312,17 +314,13 @@ fn getBarcodeMetadata<T: DetectionRXingResultRowIndicatorColumn>(
312314
leftBarcodeMetadata?;
313315

314316
if leftBarcodeMetadata.as_ref().unwrap().getColumnCount()
315-
!= rightBarcodeMetadata.as_ref().unwrap().getColumnCount()
317+
!= rightBarcodeMetadata.getColumnCount()
316318
&& leftBarcodeMetadata
317319
.as_ref()
318320
.unwrap()
319321
.getErrorCorrectionLevel()
320-
!= rightBarcodeMetadata
321-
.as_ref()
322-
.unwrap()
323-
.getErrorCorrectionLevel()
324-
&& leftBarcodeMetadata.as_ref().unwrap().getRowCount()
325-
!= rightBarcodeMetadata.as_ref().unwrap().getRowCount()
322+
!= rightBarcodeMetadata.getErrorCorrectionLevel()
323+
&& leftBarcodeMetadata.as_ref().unwrap().getRowCount() != rightBarcodeMetadata.getRowCount()
326324
{
327325
return None;
328326
}

0 commit comments

Comments
 (0)