chore: various cleanups, version bump 0.4.12

This commit is contained in:
Henry Schimke
2023-12-28 16:29:13 -06:00
parent c93594057b
commit 84a54d420d
12 changed files with 17 additions and 19 deletions

View File

@@ -149,7 +149,7 @@ impl OneDReader for Code39Reader {
}
}
impl Code39Reader {
pub const ALPHABET_STRING: &str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
pub const ALPHABET_STRING: &'static str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
/**
* These represent the encodings of characters, as patterns of wide and narrow bars.

View File

@@ -134,7 +134,7 @@ impl OneDReader for Code93Reader {
impl Code93Reader {
// Note that 'abcd' are dummy characters in place of control characters.
pub const ALPHABET_STRING: &str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*";
pub const ALPHABET_STRING: &'static str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*";
pub const ALPHABET: [char; 48] = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',

View File

@@ -49,7 +49,7 @@ pub fn buildBitArray(pairs: &Vec<ExpandedPair>) -> Option<BitArray> {
let mut binary = BitArray::with_size(size);
let mut accPos = 0;
let firstPair = pairs.get(0)?;
let firstPair = pairs.first()?;
let rp = firstPair.getRightChar().as_ref()?;
let firstValue = rp.getValue();
let mut i = 11;

View File

@@ -535,7 +535,7 @@ impl RSSExpandedReader {
let resultingString = decoder.parseInformation()?;
let firstPoints = pairs
.get(0)
.first()
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?
.getFinderPattern()
.as_ref()
@@ -565,7 +565,7 @@ impl RSSExpandedReader {
}
fn checkChecksum(&self) -> bool {
let Some(firstPair) = self.pairs.get(0) else {
let Some(firstPair) = self.pairs.first() else {
return false;
};
let checkCharacter = firstPair.getLeftChar();