diff --git a/src/error.rs b/src/error.rs index 49a1ce3e..036fbe90 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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), XmppSaslError(SaslError), + FormatError(FormatError), StreamError, EndOfDocument, } @@ -73,3 +76,9 @@ impl From for Error { Error::Base64Error(err) } } + +impl From for Error { + fn from(err: FormatError) -> Error { + Error::FormatError(err) + } +}