1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +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

@ -98,7 +98,7 @@ dangerous-h2c = []
[dependencies]
actix-codec = "0.5"
actix-service = "2"
actix-http = { version = "3.7", features = ["http2", "ws"] }
actix-http = { version = "3.10", features = ["http2", "ws"] }
actix-rt = { version = "2.1", default-features = false }
actix-tls = { version = "3.4", features = ["connect", "uri"] }
actix-utils = "3"

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
}