implement From<FormatError> for Error
This commit is contained in:
parent
1d53007a99
commit
1e65b20ead
1 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
//! Provides an `Error` for use in this crate.
|
||||
|
||||
use std::fmt::Error as FormatError;
|
||||
|
||||
use std::io;
|
||||
|
||||
use std::net::TcpStream;
|
||||
|
@ -28,6 +30,7 @@ pub enum Error {
|
|||
Base64Error(Base64Error),
|
||||
SaslError(Option<String>),
|
||||
XmppSaslError(SaslError),
|
||||
FormatError(FormatError),
|
||||
StreamError,
|
||||
EndOfDocument,
|
||||
}
|
||||
|
@ -73,3 +76,9 @@ impl From<Base64Error> for Error {
|
|||
Error::Base64Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FormatError> for Error {
|
||||
fn from(err: FormatError) -> Error {
|
||||
Error::FormatError(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue