summaryrefslogtreecommitdiffstats
path: root/examples/file-json/src/main.rs
blob: e4ff80910f0fef1786b4e91dbf833a00d8313c2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
extern crate config;

fn main() {
    let mut c = config::Config::new();

    // Read configuration from "Settings.json"
    c.merge(config::File::new("Settings", config::FileFormat::Json)).unwrap();

    println!("debug  = {:?}", c.get("debug"));
    println!("pi     = {:?}", c.get("pi"));
    println!("weight = {:?}", c.get("weight"));
}