Skip to main content

generate_leaf

Function generate_leaf 

Source
pub fn generate_leaf(s: &str) -> String
Expand description

Format a Cirru leaf token: returns the bare string if all characters are allowed in Cirru without quoting; otherwise wraps in double quotes with escape sequences. This mirrors the exact quoting behaviour used by the Cirru formatter when emitting leaf nodes, so callers outside this crate get consistent output.