Skip to content

Upgrading quick-xml 0.36 to 0.37

Breaking0.36.2 → 0.37.5Breaking10New9Changed3Fixed2

BreakingUpgrade verdict

10 breaking changes.

  • The serializer now refuses to write several plain values in a row, since reading them back would not give the same result.
  • Error types have been reorganized. Some error cases now have their own types, and some old error variants no longer exist.
  • Renames Error::EscapeError to Error::Escape to match other variants.
  • Removes DeError::InvalidInt, DeError::InvalidFloat and DeError::InvalidBoolean; the type's visitor now returns these errors.
Top 3 of 10 that need code or config changes
Breaking10
Serializer no longer serializes consequent primitive values, because they cannot be deserialized back to the same value.
Serializer
Changes the crate's errors: some variants are split into their own error types and some are removed.
Renames Error::EscapeError to Error::Escape to match other variants.
Error::EscapeErrorError::Escape
Removes DeError::InvalidInt, DeError::InvalidFloat and DeError::InvalidBoolean; the type's visitor now returns these errors.
DeError::InvalidIntDeError::InvalidFloatDeError::InvalidBoolean
Reduces the boolean values recognized by the serde Deserializer; use #[serde(deserialize_with)] to accept and parse strings for the old behavior.
Deserializer#[serde(deserialize_with)]
Splits SeError from DeError in the serialize feature; serialize functions and methods now return SeError.
SeErrorDeErrorserialize
Writer methods now return std::io::Error.
std::io::ErrorWriter
Splits NamespaceError and EncodingError from Error.
NamespaceErrorEncodingErrorError
Narrows error return types where only one variant is returned: attribute methods on BytesStart and BytesDecl now return AttrError.
ErrorBytesStartBytesDeclAttrError
Disallows serialization of consequent primitives, such as Vec<usize> or Vec<String> in $value fields, since they cannot be deserialized back identically.
Vec<usize>Vec<String>$value