Simplify using is_ascii_alphabetic and is_ascii_alphanumeric
This commit is contained in:
parent
e533bb73bc
commit
a56b0e96d0
1 changed files with 2 additions and 8 deletions
|
@ -716,17 +716,11 @@ pub mod shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_ident_head(c: char) -> bool {
|
fn is_ident_head(c: char) -> bool {
|
||||||
match c {
|
c.is_ascii_alphabetic() || c == '_'
|
||||||
'a'..='z' | 'A'..='Z' | '_' => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_ident_tail(c: char) -> bool {
|
fn is_ident_tail(c: char) -> bool {
|
||||||
match c {
|
c.is_ascii_alphanumeric() || c == '_'
|
||||||
'0'..='9' => true,
|
|
||||||
c => is_ident_head(c),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue