Open
Description
Deserialization of a list in an attribute value does not treat the tab character as a separator, despite the documentation stating that it should.
use quick_xml::de::Deserializer;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Any {
#[serde(rename = "@list")]
list: Vec<Item>,
}
#[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "lowercase")]
enum Item {
Foo,
Bar,
}
#[test]
fn main() {
// The separator between the two characters is a tab.
let str = r#"<any list="foo bar" />"#;
let mut deser = Deserializer::from_str(str);
let any = Any::deserialize(&mut deser).unwrap();
assert_eq!(any.list, vec![Item::Foo, Item::Bar]);
}
Expected behavior: The assertion passes.
Actual behavior: thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Custom("unknown variant foo\tbar
, expected foo
or bar
")'
Activity