INNER CODE UNIT · Rust
expand_identifiers
apollographql/apollo-mcp-server · crates/apollo-schema-index/src/lib.rs:120
fn expand_identifiers(text: &str) -> String {
let mut result = String::with_capacity(text.len() * 2);
let mut word_start = None;
for (i, ch) in text.char_indices() {
if ch.is_alphanumeric() || ch == '_' {
if word_start.is_none() {
word_start = Some(i);
}
} else {
if let Some(start) = word_start {
push_expanded_word(&mut result, &text[start..i]);
word_start = None;
}
result.push(ch);
}
}