From 22ed7a8549f6496135314717492096d42c5a2900 Mon Sep 17 00:00:00 2001 From: cynecx Date: Wed, 19 Jun 2024 00:21:18 +0200 Subject: [PATCH] Fix tests failures --- prost-build/src/code_generator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prost-build/src/code_generator.rs b/prost-build/src/code_generator.rs index 980f7603e..384ec9e2e 100644 --- a/prost-build/src/code_generator.rs +++ b/prost-build/src/code_generator.rs @@ -666,6 +666,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 { "" }, @@ -836,7 +838,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);