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/sessioninit.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/message/handshake/sessioninit.rs') diff --git a/src/message/handshake/sessioninit.rs b/src/message/handshake/sessioninit.rs index 04f3cff..048324d 100644 --- a/src/message/handshake/sessioninit.rs +++ b/src/message/handshake/sessioninit.rs @@ -1,9 +1,8 @@ +use crate::error::ProtocolError; use crate::message::objects::Identity; use crate::primitive::{BufferInfo, Variant, VariantMap}; use crate::HandshakeSerialize; -use failure::Error; - /// SessionInit is received along with ClientLoginAck to initialize that user Session // TODO Replace with proper types #[derive(Debug, Clone)] @@ -46,12 +45,9 @@ impl From for SessionInit { } impl HandshakeSerialize for SessionInit { - fn serialize(&self) -> Result, Error> { + fn serialize(&self) -> Result, ProtocolError> { let mut values: VariantMap = VariantMap::with_capacity(4); - values.insert( - "MsgType".to_string(), - Variant::String("SessionInit".to_string()), - ); + values.insert("MsgType".to_string(), Variant::String("SessionInit".to_string())); // values.insert( // "Identities".to_string(), // Variant::VariantList( -- cgit v1.2.3