aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rust/spectrum.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/spectrum.rs b/rust/spectrum.rs
index c5ebad3..15c1f7b 100644
--- a/rust/spectrum.rs
+++ b/rust/spectrum.rs
@@ -63,8 +63,8 @@ fn is_valid_identifier(s: &str) -> bool {
if s.starts_with("-") || s.ends_with("-") {
return false;
}
- for c in s.chars() {
- if !(c.is_alphabetic() || c == '-') {
+ for (i, c) in s.chars().enumerate() {
+ if !(c.is_alphabetic() || c == '-' || (c.is_numeric() && i > 0)) {
return false;
}
}