lesurp / OptionalStruct

Macro copying a struct with Option fields. Useful for config initialization
Apache License 2.0
36 stars 12 forks source link

[feature] .with_options variant #9

Closed norcalli closed 5 years ago

norcalli commented 5 years ago

Can we have a variant of the applicator function that doesn't use &mut self, but self, and therefore moves the value into a new result? Concretely:

fn with_options(self, options: OptionalStruct) -> Self { }

This is useful for builder patterns.