Skip to content

Commit 377243c

Browse files
committed
refactor(cubesql): Fix manual_is_ascii_check warning
1 parent 6d10dc8 commit 377243c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

rust/cubesql/cubesql/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ len_without_is_empty = "allow"
105105
len_zero = "allow"
106106
let_and_return = "allow"
107107
manual_flatten = "allow"
108-
manual_is_ascii_check = "allow"
109108
manual_map = "allow"
110109
manual_range_contains = "allow"
111110
manual_strip = "allow"

rust/cubesql/cubesql/src/compile/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ impl Dialect for MySqlDialectWithBackTicks {
2323
// See https://dev.mysql.com/doc/refman/8.0/en/identifiers.html.
2424
// We don't yet support identifiers beginning with numbers, as that
2525
// makes it hard to distinguish numeric literals.
26-
('a'..='z').contains(&ch)
27-
|| ('A'..='Z').contains(&ch)
26+
ch.is_ascii_lowercase()
27+
|| ch.is_ascii_uppercase()
2828
|| ch == '_'
2929
|| ch == '$'
3030
|| ch == '@'
3131
|| ('\u{0080}'..='\u{ffff}').contains(&ch)
3232
}
3333

3434
fn is_identifier_part(&self, ch: char) -> bool {
35-
self.is_identifier_start(ch) || ('0'..='9').contains(&ch)
35+
self.is_identifier_start(ch) || ch.is_ascii_digit()
3636
}
3737
}
3838

0 commit comments

Comments
 (0)