Skip to content
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

Add a Builder pattern to Config #78

Open
anelson opened this issue Jan 22, 2023 · 0 comments
Open

Add a Builder pattern to Config #78

anelson opened this issue Jan 22, 2023 · 0 comments

Comments

@anelson
Copy link
Collaborator

anelson commented Jan 22, 2023

In a PR elastio/elastio#6680 it became clear that because Config is marked non_exhaustive, the Config struct can't be initialized the normal way. Instead an ugly mut was used, so the Default() struct could be permuted with the appropriate config options.

This works fine but it's not particularly idiomatic or pleasant. A builder should be added for Config so that this type can be constructed without mutable state, while retaining the non_exhaustive attribute that is important for future flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant