diff --git a/src/error.rs b/src/error.rs index a65f7e2..2f7b254 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,6 +7,7 @@ use std::convert::From; use std::io; use std::num; +use std::string; use base64; use minidom; @@ -19,6 +20,7 @@ pub enum Error { XMLError(minidom::Error), Base64Error(base64::DecodeError), ParseIntError(num::ParseIntError), + ParseStringError(string::ParseError), JidParseError(jid::JidParseError), } @@ -46,6 +48,12 @@ impl From for Error { } } +impl From for Error { + fn from(err: string::ParseError) -> Error { + Error::ParseStringError(err) + } +} + impl From for Error { fn from(err: jid::JidParseError) -> Error { Error::JidParseError(err)