Skip to main content

variant_ident

Function variant_ident 

Source
pub fn variant_ident(name: &str) -> Ident
Expand description

For enum variants: PascalCase with keyword escaping. Converts val to PascalCase, then checks whether the result would collide with a Rust keyword by checking both the PascalCase form and its snake_case equivalent against the keyword list. Example: “type” → PascalCase “Type” → snake “type” → keyword → emits r#Type.