From b8ad94cd5061445a45d0790eee36014d34ad6817 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 22 Feb 2025 22:59:01 +0100 Subject: 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. --- src/message/handshake/connack.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/message/handshake/connack.rs') 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, Error> { + fn serialize(&self) -> Result, ProtocolError> { let mut bytes: Vec = 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)..])?; -- cgit v1.2.3