Function split_dynamic_string

Source
pub fn split_dynamic_string(input: &str) -> Vec<DynamicItem>
Expand description

Splits a string into formatting arguments

let s = "hello {a}, {b}{{ {c} }}";
let split = split_dynamic_string(s);
let output = vec![
    Str("hello ".to_string()),
    Var("a".to_string()),
    Str(", ".to_string()),
    Var("b".to_string()),
    Str("{ ".to_string()),
    Var("c".to_string()),
    Str(" }".to_string()),
];
assert_eq!(output, split);