Skip to content

Commit

Permalink
prost-build: derive Clone on builders
Browse files Browse the repository at this point in the history
This could be useful to e.g. initialize common fields for multiple
messages, then clone the builder to set the fields that are different.
  • Loading branch information
mzabaluev committed Mar 26, 2024
1 parent da5a5bf commit c052587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prost-build/src/code_generator.rs
Expand Up @@ -770,7 +770,7 @@ impl<'a> CodeGenerator<'a> {
"/// Builder for [`{struct_name}`](super::{struct_name})\n"
));
self.push_indent();
self.buf.push_str("#[derive(Default)]\n");
self.buf.push_str("#[derive(Clone, Default)]\n");
self.push_indent();
self.buf.push_str("pub struct ");
self.buf.push_str(builder_name);
Expand Down

0 comments on commit c052587

Please sign in to comment.