Skip to content

Commit

Permalink
Fix tests failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cynecx committed Jul 21, 2024
1 parent 65da8c0 commit a8f365f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prost-build/src/code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ impl<'a> CodeGenerator<'a> {
self.push_indent();
self.buf
.push_str("#[allow(clippy::derive_partial_eq_without_eq)]\n");
self.push_indent();
self.buf.push_str(&format!(
"#[derive(Clone, {}PartialEq, {}::Message)]\n",
if self.message_graph.can_message_derive_copy(&fq_message_name) {
Expand Down Expand Up @@ -670,6 +671,8 @@ impl<'a> CodeGenerator<'a> {
self.message_graph
.can_field_derive_copy(fq_message_name, &field.descriptor)
});

self.push_indent();
self.buf.push_str(&format!(
"#[derive(Clone, {}PartialEq, {}::Oneof)]\n",
if can_oneof_derive_copy { "Copy, " } else { "" },
Expand Down Expand Up @@ -840,7 +843,7 @@ impl<'a> CodeGenerator<'a> {
.map(|proto_name| format!("proto_name = \"{proto_name}\""))
.join(", ");

self.buf.push_str(&format!("#[prost(json({names}))]"));
self.buf.push_str(&format!("#[prost(json({names}))]\n"));
};

self.append_field_attributes(&fq_proto_enum_name, variant.proto_name);
Expand Down

0 comments on commit a8f365f

Please sign in to comment.