How to deserialize a TOML table containing an array of tables
问题 Take the following TOML data: [[items]] foo = 10 bar = 100 [[items]] foo = 12 bar = 144 And the following rust code: use serde_derive::Deserialize; use toml::from_str; use toml::value::Table; #[derive(Deserialize)] struct Item { foo: String, bar: String } fn main() { let items_string: &str = "[[items]]\nfoo = 10\nbar = 100\n\n[[items]]\nfoo = 12\nbar = 144\n"; let items_table: Table = from_str(items_string).unwrap(); let items: Vec<Item> = items_table["items"].as_array().unwrap().to_vec(); //