Pros: Would cut down on potential errors and time for adding new fields.
Cons: Slight increase in fresh compilation time.
I think it would be better to use a proc macro to reduce a lot of repetition in the crate and I would also be able to prepare the corresponding PR if you are interested.
Adding a proc macro that we can derive on the structs could automatically generate most functions for the builder pattern for us.
Currently we have this:
And we manually implement the function to set the fields:
With a proc macro we could switch to this:
And the derived trait will automatically generate the functions for Vec<T> and Option<T> like this without having to write them manually:
Pros: Would cut down on potential errors and time for adding new fields.
Cons: Slight increase in fresh compilation time.
I think it would be better to use a proc macro to reduce a lot of repetition in the crate and I would also be able to prepare the corresponding PR if you are interested.