Skip to content

Commit c052587

Browse files
committed
prost-build: derive Clone on builders
This could be useful to e.g. initialize common fields for multiple messages, then clone the builder to set the fields that are different.
1 parent da5a5bf commit c052587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: prost-build/src/code_generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ impl<'a> CodeGenerator<'a> {
770770
"/// Builder for [`{struct_name}`](super::{struct_name})\n"
771771
));
772772
self.push_indent();
773-
self.buf.push_str("#[derive(Default)]\n");
773+
self.buf.push_str("#[derive(Clone, Default)]\n");
774774
self.push_indent();
775775
self.buf.push_str("pub struct ");
776776
self.buf.push_str(builder_name);

0 commit comments

Comments
 (0)