use std::collections::HashMap; use cfg_rs::*; #[allow(dead_code)] #[derive(FromConfig, Debug)] #[config(prefix = "salak")] struct Config { #[config(default = "world")] hello: String, world: Option, #[config(name = "hello")] hey: Option, #[config(default = 123)] num: u8, arr: Vec, map: HashMap, } fn main() -> Result<(), ConfigError> { let env = Configuration::with_predefined()?; for _i in 0..1000 { let c = env.get_predefined::()?; if _i % 100 == 0 { println!("Round {}: {} - {}", _i, c.hello, c.num); } } Ok(()) }