Skip to content

Commit e134189

Browse files
committed
Remove unused error case
1 parent a2f5e15 commit e134189

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Upgrade `quick_xml` to `0.27` and `derive_builder` to `0.12` [`#67`](https://github.com/rust-syndication/atom/pull/67)
99
- Allow to configure emitted XML [`#70`](https://github.com/rust-syndication/atom/pull/70)
1010
- Switch to Rust 2021 Edition [`#74`](https://github.com/rust-syndication/atom/pull/74)
11+
- Remove unused error case `Error::Utf8` [`#73`](https://github.com/rust-syndication/atom/pull/73)
1112

1213
## 0.11.0 - 2021-10-20
1314

src/error.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
use std::error::Error as StdError;
22
use std::fmt;
3-
use std::str::Utf8Error;
43

54
#[derive(Debug)]
65
/// An error that occurred while performing an Atom operation.
76
#[non_exhaustive]
87
pub enum Error {
98
/// Unable to parse XML.
109
Xml(XmlError),
11-
/// Unable to parse UTF8 in to a string.
12-
Utf8(Utf8Error),
1310
/// Input did not begin with an opening feed tag.
1411
InvalidStartTag,
1512
/// Unexpected end of input.
@@ -29,7 +26,6 @@ impl StdError for Error {
2926
fn source(&self) -> Option<&(dyn StdError + 'static)> {
3027
match *self {
3128
Error::Xml(ref err) => Some(err),
32-
Error::Utf8(ref err) => Some(err),
3329
Error::InvalidStartTag => None,
3430
Error::Eof => None,
3531
Error::WrongDatetime(_) => None,
@@ -42,7 +38,6 @@ impl fmt::Display for Error {
4238
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4339
match *self {
4440
Error::Xml(ref err) => fmt::Display::fmt(err, f),
45-
Error::Utf8(ref err) => fmt::Display::fmt(err, f),
4641
Error::InvalidStartTag => write!(f, "input did not begin with an opening feed tag"),
4742
Error::Eof => write!(f, "unexpected end of input"),
4843
Error::WrongDatetime(ref datetime) => write!(
@@ -68,12 +63,6 @@ impl From<XmlError> for Error {
6863
}
6964
}
7065

71-
impl From<Utf8Error> for Error {
72-
fn from(err: Utf8Error) -> Error {
73-
Error::Utf8(err)
74-
}
75-
}
76-
7766
#[derive(Debug)]
7867
pub struct XmlError(quick_xml::Error);
7968

0 commit comments

Comments
 (0)