aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Sacchini <joey@sacchini.net>2020-09-30 14:51:16 -0400
committerJoey Sacchini <joey@sacchini.net>2020-09-30 14:51:16 -0400
commitcadf2f8393101fe05359e858e6966921f4a9d221 (patch)
tree37dc89fac585ce45e4d54e475cca4a22a202eb89
parent1827ef6ae21798d1f8882f1be5d445b42efd4f9f (diff)
downloadmcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.tar.gz
mcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.tar.bz2
mcproto-rs-cadf2f8393101fe05359e858e6966921f4a9d221.zip
actually implement error trait
-rw-r--r--src/deserialize.rs3
-rw-r--r--src/serialize.rs2
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 {