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