1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

relax unpin bounds on payload types (#2545)

This commit is contained in:
Rob Ede
2021-12-24 17:47:47 +00:00
committed by GitHub
parent 7b1512d863
commit 1296e07c48
22 changed files with 229 additions and 154 deletions

View File

@@ -13,16 +13,17 @@ use actix_http::{
Payload, RequestHeadType, ResponseHead, StatusCode,
};
use actix_utils::future::poll_fn;
use bytes::buf::BufMut;
use bytes::{Bytes, BytesMut};
use bytes::{buf::BufMut, Bytes, BytesMut};
use futures_core::{ready, Stream};
use futures_util::SinkExt as _;
use pin_project_lite::pin_project;
use crate::BoxError;
use super::connection::{ConnectionIo, H1Connection};
use super::error::{ConnectError, SendRequestError};
use super::{
connection::{ConnectionIo, H1Connection},
error::{ConnectError, SendRequestError},
};
pub(crate) async fn send_request<Io, B>(
io: H1Connection<Io>,
@@ -123,7 +124,12 @@ where
Ok((head, Payload::None))
}
_ => Ok((head, Payload::Stream(Box::pin(PlStream::new(framed))))),
_ => Ok((
head,
Payload::Stream {
payload: Box::pin(PlStream::new(framed)),
},
)),
}
}