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