Skip to content

Commit 5235d37

Browse files
committed
Reorder range checks to use <=
1 parent 7560c99 commit 5235d37

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ fn validate_ident(string: &str, raw: bool) {
769769
panic!("Ident is not allowed to be empty; use Option<Ident>");
770770
}
771771

772-
if string.bytes().all(|digit| digit >= b'0' && digit <= b'9') {
772+
if string.bytes().all(|digit| b'0' <= digit && digit <= b'9') {
773773
panic!("Ident cannot be a number; use Literal instead");
774774
}
775775

src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ fn float(input: Cursor) -> Result<Cursor, Reject> {
711711
fn float_digits(input: Cursor) -> Result<Cursor, Reject> {
712712
let mut chars = input.chars().peekable();
713713
match chars.next() {
714-
Some(ch) if ch >= '0' && ch <= '9' => {}
714+
Some(ch) if '0' <= ch && ch <= '9' => {}
715715
_ => return Err(Reject),
716716
}
717717

0 commit comments

Comments
 (0)