Skip to main content

ident_str

Function ident_str 

Source
pub fn ident_str(ident: &Ident) -> String
Expand description

Convert an identifier to a string, stripping the r# prefix for raw identifiers.

proc_macro2::Ident::to_string() preserves the r# prefix (e.g. r#type"r#type"), which produces incorrect protocol names. Use this function whenever an Ident is converted to a string for protocol-level output (CLI flags, HTTP routes, JSON-RPC method names, etc.).