Skip to content

Commit

Permalink
refactor(client): remove Unpin requirement from request body
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 11, 2019
1 parent 52cc3f7 commit a07142d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ impl<T, B> Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
B: Payload + Unpin + 'static,
B::Data: Unpin,
{
/// Return the inner IO object, and additional information.
///
Expand Down Expand Up @@ -384,7 +383,7 @@ where
impl<T, B> Future for Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<()>;

Expand Down Expand Up @@ -591,7 +590,7 @@ impl fmt::Debug for ResponseFuture {
impl<T, B> Future for ProtoClient<T, B>
where
T: AsyncRead + AsyncWrite + Send + Unpin + 'static,
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<proto::Dispatched>;

Expand Down
4 changes: 2 additions & 2 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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<Body>;
Expand Down
4 changes: 2 additions & 2 deletions src/proto/h2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ where

impl<B> Future for ClientTask<B>
where
B: Payload + Unpin + 'static,
B: Payload + 'static,
{
type Output = crate::Result<Dispatched>;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a07142d

Please sign in to comment.