-
Notifications
You must be signed in to change notification settings - Fork 253
ConfigBuilder (was: Add Config::with_sources()) #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
As discussed in #148 this kind of code could have the desired effect. It would be easy to extend with asynchronous configuration sources if they are ever implemented just by adding I am thinking, however, that it might be cleaner to implement a separate struct called, for instance, Just a thought of mine on this matter. |
3a2ddca to
60ac820
Compare
0625e8f to
727f388
Compare
|
So what'd you think? Merge? 😄 |
|
-- Ah, I will implement the suggested changes first, tho. |
This patch adds Config::with_sources() for builder-pattern multi-merge without calling Config::refresh(). The documentation added in the patch serves as rationale. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
727f388 to
3de9f13
Compare
|
So this is a bit off-topic for this branch, but anyways: The latest commit (which really should be squashed if we merge this) implements a builder-pattern entry point as you @szarykott suggested. I kept the entry point for the builder on the What do you think? |
|
I'd consider moving ConfigBuilder to a separate file as it seems a functionality of its own. As you might have seen in #196 I'd like to separate Config and ConfigBuilder, which basically means having two structs - one with Besides it might be better to merge #190 before considering merging this (due to ConfigKind::Frozen being removed). |
This patch adds Config::with_sources() for builder-pattern multi-merge
without calling Config::refresh().
The documentation added in the patch serves as rationale.
I'd love to see discussion on this.