From 00dbe4dc0ac1cf9436f6c1d6bcf01eb01d141d5f Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Tue, 27 Jul 2021 17:16:06 +0200 Subject: [PATCH] Fix compilation failure for `--no-default-features` --- examples/simple.rs | 10 ++-------- src/lib.rs | 4 +++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/simple.rs b/examples/simple.rs index 797cf63..17740a4 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,5 +1,5 @@ use std::{net::IpAddr, path::PathBuf}; -use confique::{Config, toml::FormatOptions}; +use confique::Config; #[derive(Debug, Config)] /// A sample configuration for our app. @@ -37,19 +37,13 @@ struct LogConfig { fn main() -> Result<(), anyhow::Error> { - println!("TEMPLATE:"); - println!("--------------------------------------------------------"); - print!("{}", confique::toml::format::(FormatOptions::default())); - println!("--------------------------------------------------------"); - let r = Conf::builder() .env() .file("examples/files/simple.toml") .file("examples/files/etc/simple.yaml") .load()?; - println!(); - println!("LOADED CONFIGURATION: {:#?}", r); + println!("{:#?}", r); Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index a3cc35a..9e55d77 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,9 +9,11 @@ mod builder; mod env; mod error; mod file; -mod format; pub mod meta; +#[cfg(any(feature = "toml", feature = "yaml"))] +mod format; + #[cfg(feature = "toml")] pub mod toml;