update format

This commit is contained in:
Marc-Antoine Arnaud 2018-05-24 18:27:59 +02:00
parent 6f424f1172
commit cb37689656
2 changed files with 31 additions and 8 deletions

View File

@ -20,7 +20,12 @@ fn de_no_content() {
let content = "";
let loaded: Result<Book, String> = from_str(content);
assert_eq!(loaded, Err(String::from("Unexpected end of stream: no root element found")));
assert_eq!(
loaded,
Err(String::from(
"Unexpected end of stream: no root element found"
))
);
}
#[test]
@ -34,5 +39,10 @@ fn de_wrong_end_balise() {
let content = "<book><author>Antoine de Saint-Exupéry<title>Little prince</title></book>";
let loaded: Result<Book, String> = from_str(content);
assert_eq!(loaded, Err(String::from("Unexpected closing tag: book, expected author")));
assert_eq!(
loaded,
Err(String::from(
"Unexpected closing tag: book, expected author"
))
);
}

View File

@ -99,7 +99,12 @@ fn se_attributes() {
}
}
assert_eq!(SubStruct::default(), SubStruct{subitem: "".to_string()});
assert_eq!(
SubStruct::default(),
SubStruct {
subitem: "".to_string()
}
);
let model = XmlStruct {
item: "something".to_string(),
@ -138,7 +143,12 @@ fn ser_rename() {
}
}
assert_eq!(SubStruct::default(), SubStruct{subitem: "".to_string()});
assert_eq!(
SubStruct::default(),
SubStruct {
subitem: "".to_string()
}
);
let model = XmlStruct {
item: "something".to_string(),
@ -180,10 +190,13 @@ fn ser_text_content_with_attributes() {
}
}
assert_eq!(SubStruct::default(), SubStruct{
subitem: "".to_string(),
text: "".to_string(),
});
assert_eq!(
SubStruct::default(),
SubStruct {
subitem: "".to_string(),
text: "".to_string(),
}
);
let model = XmlStruct {
item: "something".to_string(),