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

refactor: use Payload::from internally

This commit is contained in:
Rob Ede
2025-03-10 04:23:03 +00:00
parent e8351cc3aa
commit c6e7ebd185
3 changed files with 4 additions and 12 deletions

View File

@@ -65,9 +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::create(true);
payload.unread_data(data.into());
self.payload = Some(payload.into());
self.payload = Some(Payload::from(data.into()));
self
}