diff options
author | trinity-1686a <trinity@deuxfleurs.fr> | 2022-06-08 00:30:56 +0200 |
---|---|---|
committer | trinity-1686a <trinity@deuxfleurs.fr> | 2022-06-08 09:54:38 +0200 |
commit | 4745e7c4ba5665d3303ae567087781778cec9c34 (patch) | |
tree | 667effc91ab5674360ef0211ab32b533a35f36af /src/client.rs | |
parent | fb5462ecdb6b5731a63a902519d3ec9b1061b8dd (diff) | |
download | netapp-4745e7c4ba5665d3303ae567087781778cec9c34.tar.gz netapp-4745e7c4ba5665d3303ae567087781778cec9c34.zip |
further work on streams
most changes still required are related to error handling
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 5 |
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)) |