book_cookbook_json/
book_cookbook_json.rs1use trivet::Tools;
2
3pub fn main() {
4 let example = r##"
5 [{"color":"red","value":"#f00"},{"color":"green","value":"#0f0"},
6 {"color":"blue","value":"#00f"},{"color":"cyan","value":"#0ff"},
7 {"color":"magenta","value":"#f0f"},
8 {
9 "color":
10 "yellow",
11 "value":
12 "#ff0"
13 },
14 { "color": "black",
15 "value": "#000" }]
16 "##;
17 let tools = Tools::new();
18 let json = tools.parse_json(example).unwrap();
19 println!("Internal:\n{:?}\n", json);
20 println!("JSON:\n{}", json);
21}