Move is_ascii_ident to where it's used.

This commit is contained in:
Nicholas Nethercote
2023-11-29 01:16:25 +11:00
parent f8ce1864d3
commit dba94164e9
2 changed files with 13 additions and 13 deletions

View File

@@ -158,14 +158,3 @@ pub fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
if !result.is_empty() { Some((result, excluded_cargo_defaults)) } else { None }
}
pub(crate) fn is_ascii_ident(string: &str) -> bool {
let mut chars = string.chars();
if let Some(start) = chars.next()
&& (start.is_ascii_alphabetic() || start == '_')
{
chars.all(|char| char.is_ascii_alphanumeric() || char == '_')
} else {
false
}
}