1 use std::collections::HashMap;
3 use serde::Deserialize;
8 // Ensure this works without the removed "toml::ser::tables_last"
11 vals: HashMap<&'static str, Value>,
17 Map(HashMap<&'static str, &'static str>),
24 a.vals.insert("foo", Value::Int(0));
26 let mut sub = HashMap::new();
27 sub.insert("foo", "bar");
28 a.vals.insert("bar", Value::Map(sub));
30 toml::to_string(&a).unwrap();
34 fn vec_of_vec_issue_387() {
35 #[derive(Deserialize, Serialize, Debug)]
37 components: Vec<Component>,
38 contours: Vec<Contour>,
41 #[derive(Deserialize, Serialize, Debug)]
48 type Contour = Vec<Point>;
50 #[derive(Deserialize, Serialize, Debug)]
53 transform: (f64, f64, f64, f64, f64, f64),
56 let comp1 = Component {
57 base: "b".to_string(),
58 transform: (1.0, 0.0, 0.0, 1.0, 0.0, 0.0),
60 let comp2 = Component {
61 base: "c".to_string(),
62 transform: (1.0, 0.0, 0.0, 1.0, 0.0, 0.0),
64 let components = vec![comp1, comp2];
71 pt_type: "line".to_string(),
76 pt_type: "line".to_string(),
83 pt_type: "move".to_string(),
88 pt_type: "offcurve".to_string(),
93 pt_type: "offcurve".to_string(),
98 pt_type: "curve".to_string(),
107 let s = toml::to_string_pretty(&g1).unwrap();
108 let _g2: Glyph = toml::from_str(&s).unwrap();
112 fn vec_order_issue_356() {
113 #[derive(Serialize, Deserialize)]
119 #[derive(Serialize, Deserialize)]
126 let s = toml::to_string_pretty(&outer).unwrap();
127 let _o: Outer = toml::from_str(&s).unwrap();
131 fn values_before_tables_issue_403() {
132 #[derive(Serialize, Deserialize)]
138 #[derive(Serialize, Deserialize)]
144 #[derive(Serialize, Deserialize)]
155 b: vec!["b".to_string()],
157 a: "cba".to_string(),
158 b: vec!["cbb".to_string()],