From 1638288644bbb6cb3cc9d5858827b4196271670b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 7 Sep 2019 16:08:53 +0200 Subject: [PATCH] Reimplement std::error::Error for Error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was removed with the removal of failure, but like in minidom (#18) it was probably used by people, so let’s reintroduce it. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 1bf0381..900eed5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 {