mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
clippy fix
This commit is contained in:
@@ -348,14 +348,14 @@ fn findCType(value: &str, start: usize) -> Option<CType> {
|
||||
if c == ESCAPE_FNC_1 {
|
||||
return Some(CType::Fnc1);
|
||||
}
|
||||
if !('0'..='9').contains(&c) {
|
||||
if !c.is_ascii_digit() {
|
||||
return Some(CType::Uncodable);
|
||||
}
|
||||
if start + 1 >= last {
|
||||
return Some(CType::OneDigit);
|
||||
}
|
||||
let c = value.chars().nth(start + 1)?;
|
||||
if !('0'..='9').contains(&c) {
|
||||
if !c.is_ascii_digit() {
|
||||
return Some(CType::OneDigit);
|
||||
}
|
||||
Some(CType::TwoDigits)
|
||||
@@ -638,7 +638,7 @@ stuvwxyz{|}~\u{007F}\u{00FF}";
|
||||
}
|
||||
|
||||
fn isDigit(c: char) -> bool {
|
||||
('0'..='9').contains(&c)
|
||||
c.is_ascii_digit()
|
||||
}
|
||||
|
||||
fn canEncode(contents: &str, charset: Charset, position: usize) -> bool {
|
||||
|
||||
@@ -335,7 +335,7 @@ impl Code39Reader {
|
||||
match c {
|
||||
'+' => {
|
||||
// +A to +Z map to a to z
|
||||
if ('A'..='Z').contains(&next) {
|
||||
if next.is_ascii_uppercase() {
|
||||
decodedChar = char::from_u32(next as u32 + 32)
|
||||
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?;
|
||||
} else {
|
||||
@@ -344,7 +344,7 @@ impl Code39Reader {
|
||||
}
|
||||
'$' => {
|
||||
// $A to $Z map to control codes SH to SB
|
||||
if ('A'..='Z').contains(&next) {
|
||||
if next.is_ascii_uppercase() {
|
||||
decodedChar = char::from_u32(next as u32 - 64)
|
||||
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?;
|
||||
} else {
|
||||
|
||||
@@ -250,7 +250,7 @@ impl Code93Reader {
|
||||
match c {
|
||||
'd' => {
|
||||
// +A to +Z map to a to z
|
||||
if ('A'..='Z').contains(&next) {
|
||||
if next.is_ascii_uppercase() {
|
||||
decodedChar =
|
||||
char::from_u32(next as u32 + 32).ok_or(Exceptions::PARSE)?;
|
||||
} else {
|
||||
@@ -259,7 +259,7 @@ impl Code93Reader {
|
||||
}
|
||||
'a' => {
|
||||
// $A to $Z map to control codes SH to SB
|
||||
if ('A'..='Z').contains(&next) {
|
||||
if next.is_ascii_uppercase() {
|
||||
decodedChar =
|
||||
char::from_u32(next as u32 - 64).ok_or(Exceptions::PARSE)?;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user