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

Fix requiring generic parameters to implement Default #179

Merged
merged 1 commit into from Jan 12, 2021

Conversation

ColonelThirtyTwo
Copy link
Contributor

Currently the builder uses #[derive(Default)], which adds additional bounds to the type parameters
requiring them to implement Default. This is not required since the fields are all either Option
or PhantomData, which always have defaults, and means that Builders cannot be instantiated for
non-Default generics.

This commit makes the builder implement Default manually, without any additional bounds.

Currently the builder uses #[derive(Default)], which adds additional bounds to the type parameters
requiring them to implement Default. This is not required since the fields are all either `Option`
or `PhantomData`, which always have defaults, and means that Builders cannot be instantiated for
non-Default generics.

This commit makes the builder implement Default manually, whithout any additional bounds.
Copy link
Collaborator

@TedDriggs TedDriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to try and unwind the Travis problems before merging this, so once the question in the review is answered it should be ready to go into master.

derive_builder_core/src/builder_field.rs Show resolved Hide resolved
@TedDriggs TedDriggs merged commit 3899b89 into colin-kiegel:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants