Allow underscore in `Identifier`

main
copygirl 3 weeks ago
parent 4381fc325b
commit 90bd171212
  1. 3
      common/src/identifier.rs

@ -54,7 +54,8 @@ impl<T> Identifier<T> {
let mut i = 0; let mut i = 0;
while i < value.len() { while i < value.len() {
if let Some(c) = char::from_u32(bytes[i] as u32) { if let Some(c) = char::from_u32(bytes[i] as u32) {
if c.is_ascii_lowercase() { // TODO: Disallow leading underscore or multiple in a row?
if c.is_ascii_lowercase() || c == '_' {
i += 1; i += 1;
continue; continue;
} }

Loading…
Cancel
Save