Skip to content

Commit

Permalink
fix: writing insertion before all derives
Browse files Browse the repository at this point in the history
  • Loading branch information
vaikzs authored and stepancheg committed Oct 2, 2023
1 parent 4ab90c1 commit 7d2f5bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions protobuf-codegen/src/gen/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,17 +568,18 @@ impl<'a> MessageGen<'a> {
}

fn write_struct(&self, w: &mut CodeWriter) {
write_protoc_insertion_point_for_message(
w,
&self.customize.for_elem,
&self.message_descriptor,
);
let mut derive = Vec::new();
if self.supports_derive_partial_eq() {
derive.push("PartialEq");
}
derive.extend(&["Clone", "Default", "Debug"]);
w.derive(&derive);
write_protoc_insertion_point_for_message(
w,
&self.customize.for_elem,
&self.message_descriptor,
);

w.pub_struct(&format!("{}", self.rust_name()), |w| {
if !self.fields_except_oneof().is_empty() {
w.comment("message fields");
Expand Down

0 comments on commit 7d2f5bf

Please sign in to comment.