Skip to content

Commit 70c61e1

Browse files
committed
Docs
1 parent 4a14681 commit 70c61e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ir/ty.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ impl Type {
316316
_ => false,
317317
}
318318
}
319+
320+
/// Checks whether the name looks like an identifier,
321+
/// i.e. is alphanumeric (including '_') and does not start with a digit.
319322
pub fn is_valid_identifier(name: &str) -> bool {
320323
let mut chars = name.chars();
321324
let first_valid = chars.next().map(|c| c.is_alphabetic() || c == '_').unwrap_or(false);

0 commit comments

Comments
 (0)