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:
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user