enum Race { Griffin, Catte } impl Default for Race { fn default() -> Self { Race::Catte } } struct ResearchItem { levels: u8, points: u16 } impl Default for ResearchItem { fn default() -> Self { ResearchItem{ levels: 1, points: 0 } } } #[derive(Default)] struct Research { weapons: ResearchItem, banking: ResearchItem, manufactoring: ResearchItem, terraforming: ResearchItem, hyperspace: ResearchItem, experimentation: ResearchItem, scanning: ResearchItem } //#[derive(Default)] pub struct Player { name: String, color: (u8, u8, u8), race: Race, research: Research } impl Default for Player { fn default() -> Self { Player{ name: String::default(), //Color: (rand::thread_rng().gen(), rand::thread_rng().gen(), rand::thread_rng().gen()), color: (0,0,0), race: Race::default(), research: Research::default() } } }