|
@@ -1596,16 +1596,16 @@ fn protocol_macro(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for ClientState {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = bincode::error::Error;
|
|
|
|
|
|
fn try_from(bytes: &[u8]) -> bincode::Result<ClientState> {
|
|
|
- bincode::deserialize::<ClientState>(bytes)
|
|
|
+ bincode::decode_from_slice::<ClientState>(bytes)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
impl From<&ClientState> for Vec<u8> {
|
|
|
fn from(req: &ClientState) -> Vec<u8> {
|
|
|
- bincode::serialize(req).unwrap()
|
|
|
+ bincode::encode_to_vec(req).unwrap();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1629,7 +1629,7 @@ fn protocol_macro(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for Request {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = bincode::error::Error;
|
|
|
|
|
|
fn try_from(bytes: &[u8]) -> bincode::Result<Request> {
|
|
|
bincode::deserialize::<Request>(bytes)
|
|
@@ -1638,7 +1638,7 @@ fn protocol_macro(
|
|
|
|
|
|
impl From<&Request> for Vec<u8> {
|
|
|
fn from(req: &Request) -> Vec<u8> {
|
|
|
- bincode::serialize(req).unwrap()
|
|
|
+ bincode::encode_to_vec(req).unwrap()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1655,7 +1655,7 @@ fn protocol_macro(
|
|
|
}
|
|
|
|
|
|
impl TryFrom<&[u8]> for Reply {
|
|
|
- type Error = bincode::Error;
|
|
|
+ type Error = bincode::error::Error;
|
|
|
|
|
|
fn try_from(bytes: &[u8]) -> bincode::Result<Reply> {
|
|
|
bincode::deserialize::<Reply>(bytes)
|
|
@@ -1664,7 +1664,7 @@ fn protocol_macro(
|
|
|
|
|
|
impl From<&Reply> for Vec<u8> {
|
|
|
fn from(rep: &Reply) -> Vec<u8> {
|
|
|
- bincode::serialize(rep).unwrap()
|
|
|
+ bincode::encode_to_vec(rep).unwrap()
|
|
|
}
|
|
|
}
|
|
|
|