aboutsummaryrefslogtreecommitdiff
path: root/src/message/handshake/connack.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2025-02-22 22:59:01 +0100
committerMax Audron <audron@cocaine.farm>2025-02-22 22:59:01 +0100
commitb8ad94cd5061445a45d0790eee36014d34ad6817 (patch)
treefb7d11e136b968d2f2b3593ba9163894baed8912 /src/message/handshake/connack.rs
parentupdate dependencies and fix errors (diff)
replace deprecated failure crate with thiserror
this changes the public API in that all our methods now return a proper ProtocolError crate. Needed change anyways to properly deal with all our errors in the long run. Will still need to do a pass through the crate to remove all existing unwraps where it makes sense.
Diffstat (limited to 'src/message/handshake/connack.rs')
-rw-r--r--src/message/handshake/connack.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/message/handshake/connack.rs b/src/message/handshake/connack.rs
index a246679..bed0cb5 100644
--- a/src/message/handshake/connack.rs
+++ b/src/message/handshake/connack.rs
@@ -1,4 +1,4 @@
-use failure::Error;
+use crate::error::ProtocolError;
/// Data received right after initializing the connection
///
@@ -30,7 +30,7 @@ impl Default for ConnAck {
}
impl crate::serialize::Serialize for ConnAck {
- fn serialize(&self) -> Result<Vec<std::primitive::u8>, Error> {
+ fn serialize(&self) -> Result<Vec<std::primitive::u8>, ProtocolError> {
let mut bytes: Vec<u8> = Vec::new();
bytes.append(&mut self.flags.serialize()?);
@@ -42,7 +42,7 @@ impl crate::serialize::Serialize for ConnAck {
}
impl crate::deserialize::Deserialize for ConnAck {
- fn parse(b: &[u8]) -> Result<(usize, Self), Error> {
+ fn parse(b: &[u8]) -> Result<(usize, Self), ProtocolError> {
let (flen, flags) = u8::parse(b)?;
let (elen, extra) = i16::parse(&b[flen..])?;
let (vlen, version) = i8::parse(&b[(flen + elen)..])?;