Skip to content

Commit

Permalink
Rename EscapeError variant to match others
Browse files Browse the repository at this point in the history
  • Loading branch information
RedPhoenixQ authored and Mingun committed Oct 12, 2024
1 parent a975a82 commit e36d743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
Serialize functions and methods now return `SeError`.
- [#810]: Return `std::io::Error` from `Writer` methods.
- [#811]: Split `NamespaceError` and `EncodingError` from `Error`.
- [#811]: Renamed `Error::EscapeError` to `Error::Escape` to match other variants.

[#227]: https://github.com/tafia/quick-xml/issues/227
[#810]: https://github.com/tafia/quick-xml/pull/810
Expand Down
8 changes: 4 additions & 4 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub enum Error {
/// Encoding error
Encoding(EncodingError),
/// Escape error
EscapeError(EscapeError),
Escape(EscapeError),
/// Parsed XML has some namespace-related problems
Namespace(NamespaceError),
}
Expand Down Expand Up @@ -218,7 +218,7 @@ impl From<EscapeError> for Error {
/// Creates a new `Error::EscapeError` from the given error
#[inline]
fn from(error: EscapeError) -> Error {
Self::EscapeError(error)
Self::Escape(error)
}
}

Expand Down Expand Up @@ -247,7 +247,7 @@ impl fmt::Display for Error {
Self::IllFormed(e) => write!(f, "ill-formed document: {}", e),
Self::InvalidAttr(e) => write!(f, "error while parsing attribute: {}", e),
Self::Encoding(e) => e.fmt(f),
Self::EscapeError(e) => e.fmt(f),
Self::Escape(e) => e.fmt(f),
Self::Namespace(e) => e.fmt(f),
}
}
Expand All @@ -261,7 +261,7 @@ impl std::error::Error for Error {
Self::IllFormed(e) => Some(e),
Self::InvalidAttr(e) => Some(e),
Self::Encoding(e) => Some(e),
Self::EscapeError(e) => Some(e),
Self::Escape(e) => Some(e),
Self::Namespace(e) => Some(e),
}
}
Expand Down

0 comments on commit e36d743

Please sign in to comment.