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

Produce error for default with field.type #271

Merged
merged 1 commit into from Oct 26, 2022
Merged

Conversation

TedDriggs
Copy link
Collaborator

If field.type is used without field.build, a Move conversion is used instead of the OptionOrDefault conversion. This means that the presence of field.type prevents a field-level default from doing anything. Standard practice in derive_builder is to produce an error when parameters are not going to be used.

Fixes #269

If `field.type` is used without `field.build`, a Move conversion is used instead of the OptionOrDefault conversion.
This means that the presence of `field.type` prevents a field-level `default` from doing anything.
Standard practice in derive_builder is to produce an error when parameters are not going to be used.

Fixes #269
@TedDriggs TedDriggs merged commit e2a1a7b into master Oct 26, 2022
@TedDriggs TedDriggs deleted the default-with-field-type branch October 26, 2022 20:51
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.

Combination of #[builder(default = "foo", field(...)] should error out
1 participant