diff options
author | Joey Sacchini <joey@sacchini.net> | 2020-09-30 14:51:16 -0400 |
---|---|---|
committer | Joey Sacchini <joey@sacchini.net> | 2020-09-30 14:51:16 -0400 |
commit | cadf2f8393101fe05359e858e6966921f4a9d221 (patch) | |
tree | 37dc89fac585ce45e4d54e475cca4a22a202eb89 | |
parent | 1827ef6ae21798d1f8882f1be5d445b42efd4f9f (diff) | |
download | mcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.tar.gz mcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.tar.bz2 mcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.zip |
actually implement error trait
-rw-r--r-- | src/deserialize.rs | 3 | ||||
-rw-r--r-- | src/serialize.rs | 2 |
2 files changed, 4 insertions, 1 deletions
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 { <dyn fmt::Display>::fmt(self, f) } } +impl std::error::Error for DeserializeErr {} + impl<'b, R> Into<DeserializeResult<'b, R>> 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 { |