From 97a6a6326c83d50044109e880dfc5200d24b7aed Mon Sep 17 00:00:00 2001 From: Linus Kirkwood Date: Sat, 20 Apr 2024 21:56:30 +1000 Subject: [PATCH] Fix derive macros on enums missing newline --- xsd-parser/src/generator/enum.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xsd-parser/src/generator/enum.rs b/xsd-parser/src/generator/enum.rs index d314e72d..9ef980c1 100644 --- a/xsd-parser/src/generator/enum.rs +++ b/xsd-parser/src/generator/enum.rs @@ -19,7 +19,7 @@ pub trait EnumGenerator { ); format!( - "{comment}{macros}\n\ + "{comment}{macros}\ pub enum {name} {{\n\ {cases}\n\ {indent}__Unknown__({typename}),\n\ @@ -62,10 +62,10 @@ pub trait EnumGenerator { fn macros(&self, entity: &Enum, gen: &Generator) -> Cow<'static, str> { if entity.source == EnumSource::Union { - return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into(); + return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]\n".into(); } - let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]"; + let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]\n"; let tns = gen.target_ns.borrow(); match tns.as_ref() { Some(tn) => match tn.name() {