diff --git a/src/test.rs b/src/test.rs index 4581e9edd..2fbb7c8f0 100644 --- a/src/test.rs +++ b/src/test.rs @@ -7,7 +7,6 @@ use std::str::FromStr; use std::collections::HashMap; use actix::{Arbiter, Addr, Syn, System, SystemRunner, msgs}; -use bytes::Bytes; use cookie::Cookie; use http::{Uri, Method, Version, HeaderMap, HttpTryFrom}; use http::header::{HeaderName, HeaderValue}; @@ -16,6 +15,7 @@ use tokio_core::net::TcpListener; use tokio_core::reactor::Core; use net2::TcpBuilder; +use body::Binary; use error::Error; use handler::{Handler, Responder, ReplyItem}; use middleware::Middleware; @@ -397,9 +397,10 @@ impl TestRequest { } /// Set request payload - pub fn set_payload(mut self, data: Bytes) -> Self { + pub fn set_payload>(mut self, data: B) -> Self { + let mut data = data.into(); let mut payload = Payload::empty(); - payload.unread_data(data); + payload.unread_data(data.take()); self.payload = Some(payload); self }