pub fn format_args_dynamic(
input: &str,
variables: &ComponentArgumentVec,
) -> StringExpand description
Given a string and a key => value mapping, replaces parts of the string with the value, i.e.:
let variables: ComponentArgumentVec = vec![
ComponentArgument { name: AzString::from("a"), arg_type: AzString::from("value1") },
ComponentArgument { name: AzString::from("b"), arg_type: AzString::from("value2") },
].into();
let initial = "hello {a}, {b}{{ {c} }}";
let expected = "hello value1, value2{ {c} }".to_string();
assert_eq!(format_args_dynamic(initial, &variables), expected);Note: the number (0, 1, etc.) is the order of the argument, it is irrelevant for runtime formatting, only important for keeping the component / function arguments in order when compiling the arguments to Rust code