From cadf2f8393101fe05359e858e6966921f4a9d221 Mon Sep 17 00:00:00 2001 From: Joey Sacchini Date: Wed, 30 Sep 2020 14:51:16 -0400 Subject: actually implement error trait --- src/deserialize.rs | 3 ++- src/serialize.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/deserialize.rs b/src/deserialize.rs index f6eca35..237e1fa 100644 --- a/src/deserialize.rs +++ b/src/deserialize.rs @@ -32,13 +32,14 @@ impl fmt::Display for DeserializeErr { } } } - impl fmt::Debug for DeserializeErr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ::fmt(self, f) } } +impl std::error::Error for DeserializeErr {} + impl<'b, R> Into> for DeserializeErr { #[inline] fn into(self) -> DeserializeResult<'b, R> { diff --git a/src/serialize.rs b/src/serialize.rs index 65e2d80..d90dbf7 100644 --- a/src/serialize.rs +++ b/src/serialize.rs @@ -19,6 +19,8 @@ impl fmt::Debug for SerializeErr { } } +impl std::error::Error for SerializeErr {} + pub type SerializeResult = Result<(), SerializeErr>; pub trait Serialize: Sized { -- cgit