diff options
| author | Max Audron <audron@cocaine.farm> | 2025-02-22 22:59:01 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2025-02-22 22:59:01 +0100 |
| commit | b8ad94cd5061445a45d0790eee36014d34ad6817 (patch) | |
| tree | fb7d11e136b968d2f2b3593ba9163894baed8912 /src/message/handshake/clientinitreject.rs | |
| parent | update 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/clientinitreject.rs')
| -rw-r--r-- | src/message/handshake/clientinitreject.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/message/handshake/clientinitreject.rs b/src/message/handshake/clientinitreject.rs index d93413d..8c2fd34 100644 --- a/src/message/handshake/clientinitreject.rs +++ b/src/message/handshake/clientinitreject.rs @@ -1,8 +1,7 @@ +use crate::error::ProtocolError; use crate::primitive::{Variant, VariantMap}; use crate::HandshakeSerialize; -use failure::Error; - /// ClientInitReject is received when the initialization fails #[derive(Debug, Clone)] pub struct ClientInitReject { @@ -11,16 +10,13 @@ pub struct ClientInitReject { } impl HandshakeSerialize for ClientInitReject { - fn serialize(&self) -> Result<Vec<u8>, Error> { + fn serialize(&self) -> Result<Vec<u8>, ProtocolError> { let mut values: VariantMap = VariantMap::with_capacity(2); values.insert( "MsgType".to_string(), Variant::String("ClientInitReject".to_string()), ); - values.insert( - "ErrorString".to_string(), - Variant::String(self.error.clone()), - ); + values.insert("ErrorString".to_string(), Variant::String(self.error.clone())); return HandshakeSerialize::serialize(&values); } } |
