From a07142da2d4bdfdc7e32e8fab6acedd3e2e79165 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 11 Dec 2019 14:05:07 -0800 Subject: [PATCH] refactor(client): remove Unpin requirement from request body --- src/client/conn.rs | 5 ++--- src/client/mod.rs | 4 ++-- src/proto/h2/client.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/conn.rs b/src/client/conn.rs index 29d02cbf..6072a866 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -332,7 +332,6 @@ impl Connection where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, B: Payload + Unpin + 'static, - B::Data: Unpin, { /// Return the inner IO object, and additional information. /// @@ -384,7 +383,7 @@ where impl Future for Connection where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, - B: Payload + Unpin + 'static, + B: Payload + 'static, { type Output = crate::Result<()>; @@ -591,7 +590,7 @@ impl fmt::Debug for ResponseFuture { impl Future for ProtoClient where T: AsyncRead + AsyncWrite + Send + Unpin + 'static, - B: Payload + Unpin + 'static, + B: Payload + 'static, { type Output = crate::Result; diff --git a/src/client/mod.rs b/src/client/mod.rs index a094c913..851e17e6 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -152,7 +152,7 @@ where C: Connect + Clone + Send + Sync + 'static, C::Transport: Unpin + Send + 'static, C::Future: Unpin + Send + 'static, - B: Payload + Unpin + Send + 'static, + B: Payload + Send + 'static, B::Data: Send, { /// Send a `GET` request to the supplied `Uri`. @@ -550,7 +550,7 @@ where C: Connect + Clone + Send + Sync + 'static, C::Transport: Unpin + Send + 'static, C::Future: Unpin + Send + 'static, - B: Payload + Unpin + Send + 'static, + B: Payload + Send + 'static, B::Data: Send, { type Response = Response; diff --git a/src/proto/h2/client.rs b/src/proto/h2/client.rs index f05abca2..ea58fa25 100644 --- a/src/proto/h2/client.rs +++ b/src/proto/h2/client.rs @@ -91,7 +91,7 @@ where impl Future for ClientTask where - B: Payload + Unpin + 'static, + B: Payload + 'static, { type Output = crate::Result; @@ -133,7 +133,7 @@ where }; if !eos { - let mut pipe = PipeToSendStream::new(body, body_tx).map(|res| { + let mut pipe = Box::pin(PipeToSendStream::new(body, body_tx)).map(|res| { if let Err(e) = res { debug!("client request body error: {}", e); }