clippy fix

This commit is contained in:
Henry
2023-04-28 19:41:23 -05:00
parent 2afc6be3dc
commit ef999a4eb0
36 changed files with 122 additions and 137 deletions

View File

@@ -566,7 +566,7 @@ fn generateText(
for j in 0..wordLength.ceil() as u32 {
// for (int j = 0; j < wordLength; j++) {
let mut c = chars[maxIndex];
if j == 0 && ('a'..='z').contains(&c) && random.next_bool() {
if j == 0 && c.is_ascii_lowercase() && random.next_bool() {
c = char::from_u32(c as u32 - 'a' as u32 + 'A' as u32).unwrap();
}
result.push(c);

View File

@@ -667,15 +667,15 @@ fn encodeNumeric<T: ECIInput + ?Sized>(
}
fn isDigit(ch: char) -> bool {
('0'..='9').contains(&ch)
ch.is_ascii_digit()
}
fn isAlphaUpper(ch: char) -> bool {
ch == ' ' || ('A'..='Z').contains(&ch)
ch == ' ' || ch.is_ascii_uppercase()
}
fn isAlphaLower(ch: char) -> bool {
ch == ' ' || ('a'..='z').contains(&ch)
ch == ' ' || ch.is_ascii_lowercase()
}
fn isMixed(ch: char) -> bool {