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/clientinit.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/message/handshake/clientinit.rs') diff --git a/src/message/handshake/clientinit.rs b/src/message/handshake/clientinit.rs index d21d6aa..32e8595 100644 --- a/src/message/handshake/clientinit.rs +++ b/src/message/handshake/clientinit.rs @@ -1,8 +1,7 @@ +use crate::error::ProtocolError; use crate::primitive::{StringList, Variant, VariantMap}; use crate::HandshakeSerialize; -use failure::Error; - /// ClientInit is the Initial message send to the core after establishing a base layer comunication. /// /// Features @@ -44,12 +43,9 @@ pub struct ClientInit { } impl HandshakeSerialize for ClientInit { - fn serialize(&self) -> Result, Error> { + fn serialize(&self) -> Result, ProtocolError> { let mut values: VariantMap = VariantMap::with_capacity(5); - values.insert( - "MsgType".to_string(), - Variant::String("ClientInit".to_string()), - ); + values.insert("MsgType".to_string(), Variant::String("ClientInit".to_string())); values.insert( "ClientVersion".to_string(), Variant::String(self.client_version.clone()), -- cgit v1.2.3