Deserializing TOML into vector of enum with values
I'm trying to read a TOML file to create a struct that contains a vector of enums with associated values. Here's the sample code: extern crate serde; #[macro_use] extern crate serde_derive; extern crate toml; use std::fs::File; use std::io::Read; #[derive(Debug, Deserialize, PartialEq)] struct Actor { name: String, actions: Vec<Actions>, } #[derive(Debug, Deserialize, PartialEq)] enum Actions { Wait(usize), Move { x: usize, y: usize }, } fn main() { let input_file = "./sample_actor.toml"; let mut file = File::open(input_file).unwrap(); let mut file_content = String::new(); let _bytes_read =