-
Notifications
You must be signed in to change notification settings - Fork 90
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
LastElementNameNotAvailable error on writing #186
Comments
Here is the debug output:
|
+1 There is a bug when serializing Vec's of struct or enum. I'm working on a fix. |
I am having this issue now too, deserializing straight into a struct and converting it straight back gives this error. i do not get it when using |
I am having tha same issue in this code: use serde::{Deserialize, Serialize}; #[derive(Debug, Default, Deserialize, Serialize)] #[derive(Debug, Default, Deserialize, Serialize)] fn main() {
} That's the error: Any solution? |
I have exactly the same problem... Is there any workaround?
|
I managed to reduce it to this test case which fails for me on master: #[test]
fn serialize_nested_collection() {
#[derive(Debug, Serialize, PartialEq)]
struct OuterCollection {
a: Vec<A>,
}
#[derive(Debug, Serialize, PartialEq)]
struct A {
name: String,
}
let coll = OuterCollection {
a: vec![A {
name: "42".to_owned(),
}],
};
let str = to_string(&coll).unwrap();
println!("str={:?}", str);
}
|
WIP fix nested vec serialization: RReverser#186
Oookay, I used this |
Thanks. I stumbled over this just now. It appears, that serde-xml-rs is dead. |
I also have the same error |
@han1548772930, use the quick_xml library. Works like a charm. Code: #[derive(Debug, Default, Deserialize, Serialize)] #[derive(Debug, Default, Deserialize, Serialize)] fn main() {
|
yes I have switched to quick_xml |
Thanks for the advice. I'm also hitting this; switching to quick-xml |
I needed serde-xml-rs, though, because the XML I was working with from another program required order to be maintained |
When attempting to serialize a struct, I get the error
LastElementNameNotAvailable
Looking at the xml-rs code, that error is emitted after it fails to pop a name off of the stack.
https://github.com/netvl/xml-rs/blob/master/src/writer/emitter.rs#L351
So I'm guessing that it tried to call
end_tag
too many times?I have these types (defined by the boto AWS s3 spec)
The text was updated successfully, but these errors were encountered: