Skip to main content

expand

Function expand 

Source
pub fn expand(body: &str, vars: &BTreeMap<String, String>) -> String
Expand description

Resolve a body template against a flat variable map. {{name}} tokens are replaced; unknown tokens are left in place (so previews don’t blow up). Single-pass scan: substituted values are never themselves re-expanded, so a value containing {{...}} text renders literally instead of recursing.