Skip to content

Commit

Permalink
Fix derive macros on enums missing newline
Browse files Browse the repository at this point in the history
  • Loading branch information
lkirkwood committed Apr 20, 2024
1 parent 80050d9 commit 97a6a63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xsd-parser/src/generator/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub trait EnumGenerator {
);

format!(
"{comment}{macros}\n\
"{comment}{macros}\
pub enum {name} {{\n\
{cases}\n\
{indent}__Unknown__({typename}),\n\
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 97a6a63

Please sign in to comment.