aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.rs b/src/client.rs
index 663a3e4..cf80746 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -134,15 +134,14 @@ impl ClientConn {
self.query_send.store(None);
}
- pub(crate) async fn call<T, B>(
+ pub(crate) async fn call<T>(
self: Arc<Self>,
- rq: B,
+ rq: T,
path: &str,
prio: RequestPriority,
) -> Result<<T as Message>::Response, Error>
where
T: Message,
- B: Borrow<T>,
{
let query_send = self.query_send.load_full().ok_or(Error::ConnectionClosed)?;
@@ -164,7 +163,8 @@ impl ClientConn {
};
// Encode request
- let (body, stream) = rmp_to_vec_all_named(rq.borrow())?;
+ let (rq, stream) = rq.into_parts();
+ let body = rmp_to_vec_all_named(&rq)?;
drop(rq);
let request = QueryMessage {
@@ -217,7 +217,7 @@ impl ClientConn {
let code = resp[0];
if code == 0 {
let ser_resp = rmp_serde::decode::from_read_ref(&resp[1..])?;
- Ok(T::Response::deserialize_msg(ser_resp, stream).await)
+ Ok(T::Response::from_parts(ser_resp, stream))
} else {
let msg = String::from_utf8(resp[1..].to_vec()).unwrap_or_default();
Err(Error::Remote(code, msg))