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

@@ -65,7 +65,7 @@ impl TestResponse {
/// Set response's payload
pub fn set_payload<B: Into<Bytes>>(mut self, data: B) -> Self {
let mut payload = h1::Payload::empty();
let (_, mut payload) = h1::Payload::create(true);
payload.unread_data(data.into());
self.payload = Some(payload.into());
self
@@ -90,7 +90,8 @@ impl TestResponse {
if let Some(pl) = self.payload {
ClientResponse::new(head, pl)
} else {
ClientResponse::new(head, h1::Payload::empty().into())
let (_, payload) = h1::Payload::create(true);
ClientResponse::new(head, payload.into())
}
}
}