Sub prefixes duplication.
Greetings!
Any way to use prefix which contains different sub prefix without duplication? What I mean:
use config::{Config, Environment};
fn main() {
std::env::set_var("FOO_BAR_FIRST", "1");
std::env::set_var("FOO_SECOND", "2");
let conf = Config::builder()
.add_source(Environment::with_prefix("FOO_BAR").separator("_"))
.add_source(Environment::with_prefix("FOO").separator("_"))
.build()
.unwrap();
println!("{}", conf.cache);
}
Got: { first => 1, bar => { first => 1, }, second => 2, }.
Expected: { first => 1, second => 2, }.
Hi! Sorry for not getting back to this earlier.
I do not see how this could currently be done, sorry. How much of an issue is this for you?
I do not see how this could currently be done, sorry. How much of an issue is this for you?
Hi,
Not really :) I just start to use one prefix FOO and get data like foo.bar.
Okay. I'll close this then, if that's okay with you. I hope the next generation of the config crate (see #321) does not suffer from such issues :laughing: