aboutsummaryrefslogtreecommitdiff
path: root/src/message/handshake/sessioninit.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/sessioninit.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/sessioninit.rs')
-rw-r--r--src/message/handshake/sessioninit.rs10
1 files changed, 3 insertions, 7 deletions
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<VariantMap> for SessionInit {
}
impl HandshakeSerialize for SessionInit {
- fn serialize(&self) -> Result<Vec<u8>, Error> {
+ fn serialize(&self) -> Result<Vec<u8>, 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(