Skip to main content

resolve

Function resolve 

Source
pub fn resolve(
    src: &str,
    vars: &HashMap<String, String>,
    error_prefix: &str,
) -> Result<String, String>
Expand description

Recursively replaces every var(--name) and var(--name, fallback) substring in src with the matching entry from vars.

  • Returns Err for a missing variable with no fallback.
  • Limits recursion to depth 16; cyclic chains return an error.
  • Prepends error_prefix to any returned error message.