Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/src/bbigras_namespace.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
// related to issue https://github.com/media-io/yaserde/issues/15
use yaserde::*;

Expand Down
1 change: 1 addition & 0 deletions examples/src/boscop.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
// related to issue https://github.com/media-io/yaserde/issues/3
use yaserde::*;

Expand Down
1 change: 1 addition & 0 deletions examples/src/generic.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
use yaserde::*;

#[derive(YaSerialize, YaDeserialize, Debug, Default, Clone, Eq, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions examples/src/ln_dom.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
// related to issue https://github.com/media-io/yaserde/issues/11
use yaserde::*;

Expand Down
1 change: 1 addition & 0 deletions examples/src/same_element_different_namespaces.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
// related to issue https://github.com/media-io/yaserde/issues/186
use yaserde::*;

Expand Down
2 changes: 1 addition & 1 deletion examples/tests/data/svd.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<device schemaversion="foo" xmlns="http://www.w3.org/2001/XMLSchema-instance" xsnonamespaceschemalocation="CMSIS-SVD.xsd">
<devattributes>
<vendor>Renesas</vendor>
Expand Down
2 changes: 2 additions & 0 deletions yaserde/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct Deserializer<R: Read> {
depth: usize,
reader: EventReader<R>,
peeked: Option<XmlEvent>,
pub inner_struct_label: Option<&'static str>,
}

impl<R: Read> Deserializer<R> {
Expand All @@ -26,6 +27,7 @@ impl<R: Read> Deserializer<R> {
depth: 0,
reader,
peeked: None,
inner_struct_label: None,
}
}

Expand Down
2 changes: 1 addition & 1 deletion yaserde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ macro_rules! serialize_and_validate {
log::debug!("serialize_and_validate @ {}:{}", file!(), line!());
let data: Result<String, String> = yaserde::ser::to_string(&$model);

let content = &format!(r#"<?xml version="1.0" encoding="utf-8"?>{}"#, $content);
let content = &format!(r#"<?xml version="1.0" encoding="UTF-8"?>{}"#, $content);
assert_eq!(
data,
Ok(content.split("\n").map(|s| s.trim()).collect::<String>())
Expand Down
4 changes: 2 additions & 2 deletions yaserde/tests/cdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ fn test_cdata_serialization() {
msgdata: "<tag>Some unescaped content</tag>".to_string(),
};
let xml_output = yaserde::ser::to_string(&test_data).expect("Serialization failed");
let expected_output = r#"<?xml version="1.0" encoding="utf-8"?><teststruct><msgdata><![CDATA[<tag>Some unescaped content</tag>]]></msgdata></teststruct>"#;
let expected_output = r#"<?xml version="1.0" encoding="UTF-8"?><teststruct><msgdata><![CDATA[<tag>Some unescaped content</tag>]]></msgdata></teststruct>"#;
assert_eq!(xml_output, expected_output);
}

#[test]
fn test_cdata_deserialization() {
init();
let xml = r#"<?xml version="1.0" encoding="utf-8"?><teststruct><msgdata><![CDATA[<tag>Some unescaped content</tag>]]></msgdata></teststruct>"#;
let xml = r#"<?xml version="1.0" encoding="UTF-8"?><teststruct><msgdata><![CDATA[<tag>Some unescaped content</tag>]]></msgdata></teststruct>"#;
let r: TestStruct = yaserde::de::from_str(xml).unwrap();
let expected_output = TestStruct {
msgdata: "<tag>Some unescaped content</tag>".to_string(),
Expand Down
Loading
Loading