handlebars-rust
handlebars-rust copied to clipboard
`#[non_exhaustive]` `struct`s require the use of `let mut` to specify non-default options
Since #647, using non-default values for struct
s with #[non_exhaustive]
(like DirectorySourceOptions
for example) requires the use of let mut
to store the default value followed by mutating that value, since using functional record updates doesn't work in the presence of #[non_exhaustive]
.
This isn't an important issue to fix (it's just an added inconvenience I have run into), and having non_exhaustive
to be able to more easily update the type is probably worth not supporting the functional record update syntax, but since I haven't seen this being brought up yet I wanted to do so.
Just adding a builder type / functions like fn with_template_extension(self, extension: impl Into<String>) -> Self
may potentially be a good idea though?