colin-kiegel / rust-derive-builder

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

Break out distribute_and_unnest_attrs #243

Closed ijackson closed 2 years ago

ijackson commented 2 years ago

RFC, as discussed in https://github.com/colin-kiegel/rust-derive-builder/pull/241#issuecomment-1069346362 . It seemed better to demonstrate it rather than talk in the abstract.

I think it has come out quite nicely. In particular, removing the duplicated specification of the output field variables now means it's not possible to accidentally get the unnesting and copying information out of step.

But if you prefer the code the way it is, please do feel free to say so and just close this MR.