colin-kiegel / rust-derive-builder

derive builder implementation for rust structs
https://colin-kiegel.github.io/rust-derive-builder/
Apache License 2.0
1.32k stars 88 forks source link

Produce error for `default` with `field.type` #271

Closed TedDriggs closed 2 years ago

TedDriggs commented 2 years ago

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