Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused error case #73

Merged
merged 1 commit into from Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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