Skip to content

Commit a07142d

Browse files
committed
refactor(client): remove Unpin requirement from request body
1 parent 52cc3f7 commit a07142d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/client/conn.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ impl<T, B> Connection<T, B>
332332
where
333333
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
334334
B: Payload + Unpin + 'static,
335-
B::Data: Unpin,
336335
{
337336
/// Return the inner IO object, and additional information.
338337
///
@@ -384,7 +383,7 @@ where
384383
impl<T, B> Future for Connection<T, B>
385384
where
386385
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
387-
B: Payload + Unpin + 'static,
386+
B: Payload + 'static,
388387
{
389388
type Output = crate::Result<()>;
390389

@@ -591,7 +590,7 @@ impl fmt::Debug for ResponseFuture {
591590
impl<T, B> Future for ProtoClient<T, B>
592591
where
593592
T: AsyncRead + AsyncWrite + Send + Unpin + 'static,
594-
B: Payload + Unpin + 'static,
593+
B: Payload + 'static,
595594
{
596595
type Output = crate::Result<proto::Dispatched>;
597596

src/client/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ where
152152
C: Connect + Clone + Send + Sync + 'static,
153153
C::Transport: Unpin + Send + 'static,
154154
C::Future: Unpin + Send + 'static,
155-
B: Payload + Unpin + Send + 'static,
155+
B: Payload + Send + 'static,
156156
B::Data: Send,
157157
{
158158
/// Send a `GET` request to the supplied `Uri`.
@@ -550,7 +550,7 @@ where
550550
C: Connect + Clone + Send + Sync + 'static,
551551
C::Transport: Unpin + Send + 'static,
552552
C::Future: Unpin + Send + 'static,
553-
B: Payload + Unpin + Send + 'static,
553+
B: Payload + Send + 'static,
554554
B::Data: Send,
555555
{
556556
type Response = Response<Body>;

src/proto/h2/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ where
9191

9292
impl<B> Future for ClientTask<B>
9393
where
94-
B: Payload + Unpin + 'static,
94+
B: Payload + 'static,
9595
{
9696
type Output = crate::Result<Dispatched>;
9797

@@ -133,7 +133,7 @@ where
133133
};
134134

135135
if !eos {
136-
let mut pipe = PipeToSendStream::new(body, body_tx).map(|res| {
136+
let mut pipe = Box::pin(PipeToSendStream::new(body, body_tx)).map(|res| {
137137
if let Err(e) = res {
138138
debug!("client request body error: {}", e);
139139
}

0 commit comments

Comments
 (0)