Sub prefixes duplication.
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 265
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
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, }.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Rust example with Environment::with_prefix and the two overlapping prefixes, then trace how environment keys are merged into Config. Done means the resulting cache contains first and second without the duplicated nested bar entry, while preserving both environment values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100