rename helper methods

This commit is contained in:
Vukašin Stepanović
2023-02-15 12:52:59 +00:00
parent bfcdb397ad
commit 935519ced5
133 changed files with 858 additions and 1044 deletions

View File

@@ -105,7 +105,7 @@ impl Reader for DataMatrixReader {
DECODER.decode(&bits)?
}
} else {
return Err(Exceptions::notFoundEmpty());
return Err(Exceptions::notFound);
};
// decoderRXingResult = DECODER.decode(detectorRXingResult.getBits())?;
@@ -181,10 +181,10 @@ impl DataMatrixReader {
*/
fn extractPureBits(&self, image: &BitMatrix) -> Result<BitMatrix, Exceptions> {
let Some(leftTopBlack) = image.getTopLeftOnBit() else {
return Err(Exceptions::notFoundEmpty())
return Err(Exceptions::notFound)
};
let Some(rightBottomBlack) = image.getBottomRightOnBit()else {
return Err(Exceptions::notFoundEmpty())
return Err(Exceptions::notFound)
};
let moduleSize = Self::moduleSize(&leftTopBlack, image)?;
@@ -197,7 +197,7 @@ impl DataMatrixReader {
let matrixWidth = (right as i32 - left as i32 + 1) / moduleSize as i32;
let matrixHeight = (bottom as i32 - top as i32 + 1) / moduleSize as i32;
if matrixWidth <= 0 || matrixHeight <= 0 {
return Err(Exceptions::notFoundEmpty());
return Err(Exceptions::notFound);
// throw NotFoundException.getNotFoundInstance();
}
@@ -234,12 +234,12 @@ impl DataMatrixReader {
x += 1;
}
if x == width {
return Err(Exceptions::notFoundEmpty());
return Err(Exceptions::notFound);
}
let moduleSize = x - leftTopBlack[0];
if moduleSize == 0 {
return Err(Exceptions::notFoundEmpty());
return Err(Exceptions::notFound);
}
Ok(moduleSize)