diff --git a/CHANGELOG.md b/CHANGELOG.md index da928b47a..ff6e81c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Remove ambiguous statements about escaping from documentation. [`#171`](https://github.com/rust-syndication/rss/pull/171) +- Update `quick-xml` to 0.37. [`#172`](https://github.com/rust-syndication/rss/pull/172) ## 2.0.9 - 2024-08-28 diff --git a/Cargo.toml b/Cargo.toml index 8a32050fa..19d605f22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ validation = ["chrono", "chrono/std", "url", "mime"] with-serde = ["serde", "atom_syndication/with-serde"] [dependencies] -quick-xml = { version = "0.36", features = ["encoding"] } +quick-xml = { version = "0.37", features = ["encoding"] } atom_syndication = { version = "0.12", optional = true } chrono = { version = "0.4.31", optional = true, default-features = false, features = ["alloc"] } derive_builder = { version = "0.20", optional = true } diff --git a/src/error.rs b/src/error.rs index 616474d56..c4bc7b540 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,7 +7,9 @@ use std::error::Error as StdError; use std::fmt; +use std::io; use std::str::Utf8Error; +use std::sync::Arc; use quick_xml::Error as XmlError; @@ -51,6 +53,18 @@ impl From for Error { } } +impl From for Error { + fn from(err: quick_xml::encoding::EncodingError) -> Error { + Error::Xml(XmlError::Encoding(err)) + } +} + +impl From for Error { + fn from(err: io::Error) -> Error { + Error::Xml(XmlError::Io(Arc::new(err))) + } +} + impl From for Error { fn from(err: Utf8Error) -> Error { Error::Utf8(err)