2 extern crate serde_derive
;
5 use std
::collections
::HashMap
;
9 #[serde(serialize_with = "toml::ser::tables_last")]
10 vals
: HashMap
<&'
static str, Value
>,
16 Map(HashMap
<&'
static str, &'
static str>),
22 let mut a
= A { vals: HashMap::new() }
;
23 a
.vals
.insert("foo", Value
::Int(0));
25 let mut sub
= HashMap
::new();
26 sub
.insert("foo", "bar");
27 a
.vals
.insert("bar", Value
::Map(sub
));
29 toml
::to_string(&a
).unwrap();