Use thiserror for error handling with less boilerplate

This commit is contained in:
Steve Cook
2023-02-20 09:41:28 -05:00
parent 01e4f4a126
commit f8b29f37db
135 changed files with 868 additions and 905 deletions

View File

@@ -89,7 +89,7 @@ pub fn decode(bytes: &[u8], mode: u8) -> Result<DecoderRXingResult> {
let pc = getPostCode2(bytes);
let ps2Length = getPostCode2Length(bytes) as usize;
if ps2Length > 10 {
return Err(Exceptions::format);
return Err(Exceptions::FORMAT);
}
// NumberFormat df = new DecimalFormat("0000000000".substring(0, ps2Length));
// postcode = df.format(pc);