aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client.rs b/src/client.rs
index bce7aca..bc16fb1 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -227,9 +227,8 @@ impl ClientConn {
let code = resp[0];
if code == 0 {
- let mut deser = rmp_serde::decode::Deserializer::from_read_ref(&resp[1..]);
- let res = T::Response::deserialize_msg(&mut deser, stream).await?;
- Ok(res)
+ let ser_resp = rmp_serde::decode::from_read_ref(&resp[1..])?;
+ Ok(T::Response::deserialize_msg(ser_resp, stream).await)
} else {
let msg = String::from_utf8(resp[1..].to_vec()).unwrap_or_default();
Err(Error::Remote(code, msg))