yaml_extras
Misc yaml-related utility functions.
Restructure
If you use YAML for a configuration file, you might want to allow to use both things like:
compiler:
command: cargo build
and:
compiler.command: cargo build
(Or not. I know I needed that. Whatever.)
The functions restructure_map and restructure_from_str allow just that,
converting dotted keys to inner fiels:
let s1 = r#"
compiler:
command: cargo build
"#;
let s2 = r#"
compiler.command: cargo build
"#;
let v1: Value = from_str.unwrap;
let v2 = restructure_from_str.unwrap;
assert_eq!;
License: MPL-2.0