mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Simplify using is_ascii_alphabetic and is_ascii_alphanumeric
This commit is contained in:
parent
e533bb73bc
commit
a56b0e96d0
@ -716,17 +716,11 @@ pub mod shell {
|
||||
}
|
||||
|
||||
fn is_ident_head(c: char) -> bool {
|
||||
match c {
|
||||
'a'..='z' | 'A'..='Z' | '_' => true,
|
||||
_ => false,
|
||||
}
|
||||
c.is_ascii_alphabetic() || c == '_'
|
||||
}
|
||||
|
||||
fn is_ident_tail(c: char) -> bool {
|
||||
match c {
|
||||
'0'..='9' => true,
|
||||
c => is_ident_head(c),
|
||||
}
|
||||
c.is_ascii_alphanumeric() || c == '_'
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Loading…
Reference in New Issue
Block a user