Skip to content

Commit

Permalink
Remove unused error case
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Dec 29, 2022
1 parent a2f5e15 commit e134189
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@
- Upgrade `quick_xml` to `0.27` and `derive_builder` to `0.12` [`#67`](https://github.com/rust-syndication/atom/pull/67)
- Allow to configure emitted XML [`#70`](https://github.com/rust-syndication/atom/pull/70)
- Switch to Rust 2021 Edition [`#74`](https://github.com/rust-syndication/atom/pull/74)
- Remove unused error case `Error::Utf8` [`#73`](https://github.com/rust-syndication/atom/pull/73)

## 0.11.0 - 2021-10-20

Expand Down
11 changes: 0 additions & 11 deletions src/error.rs
@@ -1,15 +1,12 @@
use std::error::Error as StdError;
use std::fmt;
use std::str::Utf8Error;

#[derive(Debug)]
/// An error that occurred while performing an Atom operation.
#[non_exhaustive]
pub enum Error {
/// Unable to parse XML.
Xml(XmlError),
/// Unable to parse UTF8 in to a string.
Utf8(Utf8Error),
/// Input did not begin with an opening feed tag.
InvalidStartTag,
/// Unexpected end of input.
Expand All @@ -29,7 +26,6 @@ impl StdError for Error {
fn source(&self) -> Option<&(dyn StdError + 'static)> {
match *self {
Error::Xml(ref err) => Some(err),
Error::Utf8(ref err) => Some(err),
Error::InvalidStartTag => None,
Error::Eof => None,
Error::WrongDatetime(_) => None,
Expand All @@ -42,7 +38,6 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Error::Xml(ref err) => fmt::Display::fmt(err, f),
Error::Utf8(ref err) => fmt::Display::fmt(err, f),
Error::InvalidStartTag => write!(f, "input did not begin with an opening feed tag"),
Error::Eof => write!(f, "unexpected end of input"),
Error::WrongDatetime(ref datetime) => write!(
Expand All @@ -68,12 +63,6 @@ impl From<XmlError> for Error {
}
}

impl From<Utf8Error> for Error {
fn from(err: Utf8Error) -> Error {
Error::Utf8(err)
}
}

#[derive(Debug)]
pub struct XmlError(quick_xml::Error);

Expand Down

0 comments on commit e134189

Please sign in to comment.