Since #647, using non-default values for structs 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?
Since #647, using non-default values for
structs with#[non_exhaustive](likeDirectorySourceOptionsfor example) requires the use oflet mutto 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_exhaustiveto 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>) -> Selfmay potentially be a good idea though?