Remove Source trait and Config::from_sources

I'm not sure about a good high level API.
This commit is contained in:
Lukas Kalbertodt
2021-07-24 22:25:40 +02:00
parent 6aece589c4
commit 76373278b0
4 changed files with 63 additions and 77 deletions

View File

@@ -1,4 +1,4 @@
use std::{net::IpAddr, path::{Path, PathBuf}};
use std::{net::IpAddr, path::PathBuf};
use confique::{Config, toml::FormatOptions};
#[derive(Debug, Config)]
@@ -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::from_sources(&[
// &Path::new("examples/files/simple.toml"),
// &Path::new("examples/files/etc/simple.yaml"),
// ])?;
println!();
println!("LOADED CONFIGURATION: {:#?}", r);
// println!();
// println!("LOADED CONFIGURATION: {:#?}", r);
Ok(())
}