diff options
Diffstat (limited to 'src/message/handshake/clientloginreject.rs')
| -rw-r--r-- | src/message/handshake/clientloginreject.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/message/handshake/clientloginreject.rs b/src/message/handshake/clientloginreject.rs index 0c0fc85..964ce0c 100644 --- a/src/message/handshake/clientloginreject.rs +++ b/src/message/handshake/clientloginreject.rs @@ -1,8 +1,7 @@ +use crate::error::ProtocolError; use crate::primitive::{Variant, VariantMap}; use crate::HandshakeSerialize; -use failure::Error; - /// ClientLoginReject is received after the client failed to login /// It contains an error message as String #[derive(Debug, Clone)] @@ -11,16 +10,13 @@ pub struct ClientLoginReject { } impl HandshakeSerialize for ClientLoginReject { - fn serialize(&self) -> Result<Vec<u8>, Error> { + fn serialize(&self) -> Result<Vec<u8>, ProtocolError> { let mut values: VariantMap = VariantMap::with_capacity(1); values.insert( "MsgType".to_string(), Variant::String("ClientLoginReject".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); } } |
