Add Builder type as convenient high level loading API

This commit is contained in:
Lukas Kalbertodt
2021-07-25 09:41:06 +02:00
parent 76373278b0
commit ca5bb2488f
4 changed files with 82 additions and 7 deletions

View File

@@ -41,13 +41,13 @@ fn main() -> Result<(), anyhow::Error> {
print!("{}", confique::toml::format::<Conf>(FormatOptions::default()));
println!("--------------------------------------------------------");
// let r = Conf::from_sources(&[
// &Path::new("examples/files/simple.toml"),
// &Path::new("examples/files/etc/simple.yaml"),
// ])?;
let r = Conf::builder()
.file("examples/files/simple.toml")
.file("examples/files/etc/simple.yaml")
.load()?;
// println!();
// println!("LOADED CONFIGURATION: {:#?}", r);
println!();
println!("LOADED CONFIGURATION: {:#?}", r);
Ok(())
}