error: Add JidParseError.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-29 06:06:41 +01:00
parent 72a6eee2fd
commit 7cd4a49011

View file

@ -4,6 +4,7 @@ use std::num;
use base64; use base64;
use minidom; use minidom;
use jid;
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
@ -12,6 +13,7 @@ pub enum Error {
XMLError(minidom::Error), XMLError(minidom::Error),
Base64Error(base64::DecodeError), Base64Error(base64::DecodeError),
ParseIntError(num::ParseIntError), ParseIntError(num::ParseIntError),
JidParseError(jid::JidParseError),
} }
impl From<io::Error> for Error { impl From<io::Error> for Error {
@ -37,3 +39,9 @@ impl From<num::ParseIntError> for Error {
Error::ParseIntError(err) Error::ParseIntError(err)
} }
} }
impl From<jid::JidParseError> for Error {
fn from(err: jid::JidParseError) -> Error {
Error::JidParseError(err)
}
}