11use std:: error:: Error as StdError ;
22use std:: fmt;
3- use std:: str:: Utf8Error ;
43
54#[ derive( Debug ) ]
65/// An error that occurred while performing an Atom operation.
76#[ non_exhaustive]
87pub 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 ) ]
7867pub struct XmlError ( quick_xml:: Error ) ;
7968
0 commit comments