implement From<FormatError> for Error

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-02 17:21:03 +01:00
parent 1d53007a99
commit 1e65b20ead

View file

@ -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)
}
}