Skip to main content

expand

Function expand 

Source
pub fn expand(text: &str, lookup: &dyn Fn(&str) -> Option<String>) -> String
Expand description

Replace $(NAME) and ${NAME} using lookup. $(NAME=default) falls back to the default; unknown names are left as written, like Phoebus does. Text whose expansion would take more than [MAX_WORK] (16 KiB) of output, such as nested $(M) that each name $(M) several times, is returned unexpanded, as written, rather than truncated.