1 use config::Config;
2 use std::collections::HashMap;
3 
main()4 fn main() {
5     let settings = Config::builder()
6         // Add in `./Settings.toml`
7         .add_source(config::File::with_name("examples/simple/Settings"))
8         // Add in settings from the environment (with a prefix of APP)
9         // Eg.. `APP_DEBUG=1 ./target/app` would set the `debug` key
10         .add_source(config::Environment::with_prefix("APP"))
11         .build()
12         .unwrap();
13 
14     // Print out our settings (as a HashMap)
15     println!(
16         "{:?}",
17         settings
18             .try_deserialize::<HashMap<String, String>>()
19             .unwrap()
20     );
21 }
22