fix de-ser of option of struct

This commit is contained in:
Marc-Antoine Arnaud 2018-11-20 14:11:37 +01:00
parent 342dc3930d
commit 20aae33c80
3 changed files with 3 additions and 3 deletions

View File

@ -137,6 +137,6 @@ fn de_option_struct() {
}
}
convert_and_validate!(Test, Some(Test{field: SubTest{content: Some("value".to_string())}}), Some("<Test><field><content>value</content></field></Test>"));
convert_and_validate!(Test, Some(Test{field: SubTest{content: Some("value".to_string())}}), Some("<field><content>value</content></field>"));
convert_and_validate!(Test, None, None);
}

View File

@ -140,6 +140,6 @@ fn de_option_struct() {
}
}
convert_and_validate!(Test, Some(Test{field: SubTest{content: Some("value".to_string())}}), Some("<Test><field><content>value</content></field></Test>"));
convert_and_validate!(Test, Some(Test{field: SubTest{content: Some("value".to_string())}}), Some("<field><content>value</content></field>"));
convert_and_validate!(Test, None, None);
}

View File

@ -265,7 +265,7 @@ pub fn serialize(
let start_event = XmlEvent::start_element(#label_name);
let _ret = writer.write(start_event);
writer.set_skip_start_end(false);
writer.set_skip_start_end(true);
match item.serialize(writer) {
Ok(()) => {},
Err(msg) => {