mirror of https://github.com/fafhrd91/actix-web
use more efficient string conversion
This commit is contained in:
parent
28ed10ef0a
commit
65ca23ec56
|
@ -46,7 +46,7 @@ impl FrozenClientRequest {
|
|||
/// Send a body.
|
||||
pub fn send_body<B>(&self, body: B) -> SendClientRequest
|
||||
where
|
||||
B: actix_http::body::MessageBody + 'static,
|
||||
B: MessageBody + 'static,
|
||||
{
|
||||
RequestSender::Rc(self.head.clone(), None).send_body(
|
||||
self.addr,
|
||||
|
|
|
@ -191,6 +191,7 @@ where
|
|||
// try to reuse body
|
||||
match body {
|
||||
Some(ref bytes) => AnyBody::from(bytes.clone()),
|
||||
// TODO: should this be AnyBody::Empty or AnyBody::None.
|
||||
_ => AnyBody::empty(),
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -231,7 +231,7 @@ impl RequestSender {
|
|||
response_decompress,
|
||||
timeout,
|
||||
config,
|
||||
AnyBody::copy_from_slice(body.as_bytes()),
|
||||
AnyBody::from_message_body(body.into_bytes()),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ impl RequestSender {
|
|||
response_decompress,
|
||||
timeout,
|
||||
config,
|
||||
AnyBody::copy_from_slice(body.as_bytes()),
|
||||
AnyBody::from_message_body(body.into_bytes()),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue