mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
error: Implement From<std::string::ParseError>.
This commit is contained in:
parent
e3acb55b49
commit
51eecda4fd
1 changed files with 8 additions and 0 deletions
|
@ -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<num::ParseIntError> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<string::ParseError> for Error {
|
||||
fn from(err: string::ParseError) -> Error {
|
||||
Error::ParseStringError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jid::JidParseError> for Error {
|
||||
fn from(err: jid::JidParseError) -> Error {
|
||||
Error::JidParseError(err)
|
||||
|
|
Loading…
Reference in a new issue