Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error DocumentStartAlreadyEmitted while trying to serialize simple structure in 0.6.0 #197

Open
codebling opened this issue Feb 9, 2023 · 0 comments

Comments

@codebling
Copy link

codebling commented Feb 9, 2023

The following extremely simple code reproduces the issue.

enum EnumOne {
  A(EnumTwo),
}

enum EnumTwo {
  Z(StructOne),
}

struct StructOne {
}

let obj = EnumOne::A(
  EnumTwo::Z (
    StructOne {
    }
  )
);
serde_xml_rs::to_string(&obj).unwrap();

And produces the following error

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Writer { source: DocumentStartAlreadyEmitted }', src/main.rs:24:33

I've created a minimal repo which reproduces the issue

Versions are
serde = "1.0.152"
serde-xml-rs = "0.6.0"

The code works in serde-xml-rs 0.5.1

@codebling codebling changed the title Error DocumentStartAlreadyEmitted while trying to serialize simple structure Error DocumentStartAlreadyEmitted while trying to serialize simple structure in 0.6.0 Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant