Structures Are Not Supported for XSD `simpleType`s

I was trying to parse some XML (well, Atom, but you get it)… and started getting this while using the rust quick-xml crate.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Unsupported("structures are not supported for XSD `simpleType`s")', examples/test_quickxml2.rs:79:42

I was trying to parse (essentially) this:

<field>foo</field>

Using an enum like this:

enum KeyValue {
    #[serde(rename="$text")]
    text { value: String },
}

But what I needed was this:

enum KeyValue {
	#[serde(rename="$text")]
	text (String),
}

Instead of shoving it into a struct I just needed a simple type.



#rust #quick-xml #errors