Skip to main content

expand

Function expand 

Source
pub fn expand<'a>(text: &'a str, source: &str) -> Cow<'a, str>
Expand description

Expand $VAR, ${VAR}, ${VAR:-default} and $$ in one string.

source names the file for the warning an unset variable produces; it has no effect on the result.

Borrows when there is nothing to do, which is the overwhelmingly common case — most strings in a TOML file contain no $ at all.