Skip to content

Commit

Permalink
Auto merge of rust-lang#9110 - klensy:simple-fix, r=alexcrichton
Browse files Browse the repository at this point in the history
simplify char range check

Instead manually checking ranges for char, use std method.
  • Loading branch information
bors committed Jan 29, 2021
2 parents c3abcfe + dcc9587 commit 8a3361c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/cargo-platform/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ impl<'a> Iterator for Tokenizer<'a> {
}

fn is_ident_start(ch: char) -> bool {
ch == '_' || ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')
ch == '_' || ch.is_ascii_alphabetic()
}

fn is_ident_rest(ch: char) -> bool {
is_ident_start(ch) || ('0' <= ch && ch <= '9')
is_ident_start(ch) || ch.is_ascii_digit()
}

impl<'a> Token<'a> {
Expand Down

0 comments on commit 8a3361c

Please sign in to comment.