1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Misc yaml-related utility functions.
//!
//! # Restructure
//!
//! If you use YAML for a configuration file, you might want to allow to use
//! both things like:
//!
//! ```yaml
//! compiler:
//! command: cargo build
//! ```
//!
//! and:
//!
//! ```yaml
//! compiler.command: cargo build
//! ```
//!
//! (Or not. I know *I* needed that. Whatever.)
//!
//! The `Restructurer` methods 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: serde_yaml::Value = serde_yaml::from_str(s1)?;
//! let v2 = yaml_extras::Restructurer::new()
//! .apply_str(&s2)?;
//! assert_eq!(v1, v2);
//! # Ok::<(), yaml_extras::Error>(())
//! ```
pub use ;
pub use Restructurer;
pub use Documenter;