mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
Reimplement std::error::Error for Error.
It was removed with the removal of failure, but like in minidom (#18) it was probably used by people, so let’s reintroduce it.
This commit is contained in:
parent
b244a21e1a
commit
1638288644
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
//! For usage, check the documentation on the `Jid` struct.
|
||||
|
||||
use std::convert::Into;
|
||||
use std::error::Error as StdError;
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
|
||||
|
@ -35,6 +36,8 @@ pub enum JidParseError {
|
|||
EmptyResource,
|
||||
}
|
||||
|
||||
impl StdError for JidParseError {}
|
||||
|
||||
impl fmt::Display for JidParseError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(fmt, "{}", match self {
|
||||
|
|
Loading…
Reference in a new issue