diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 1c8206ef2..b64c71a8a 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -53,7 +53,6 @@ bitflags = "1.2" bytes = "1" bytestring = "1" cookie = { version = "0.14.1", features = ["percent-encode"] } -copyless = "0.1.4" derive_more = "0.99.5" either = "1.5.3" encoding_rs = "0.8" diff --git a/actix-http/src/message.rs b/actix-http/src/message.rs index 3673017bc..8c401a5ba 100644 --- a/actix-http/src/message.rs +++ b/actix-http/src/message.rs @@ -3,7 +3,6 @@ use std::net; use std::rc::Rc; use bitflags::bitflags; -use copyless::BoxHelper; use crate::extensions::Extensions; use crate::header::HeaderMap; @@ -388,12 +387,6 @@ impl BoxedResponseHead { pub fn new(status: StatusCode) -> Self { RESPONSE_POOL.with(|p| p.get_message(status)) } - - pub(crate) fn take(&mut self) -> Self { - BoxedResponseHead { - head: self.head.take(), - } - } } impl std::ops::Deref for BoxedResponseHead { @@ -480,17 +473,17 @@ impl BoxedResponsePool { BoxedResponseHead { head: Some(head) } } else { BoxedResponseHead { - head: Some(Box::alloc().init(ResponseHead::new(status))), + head: Some(Box::new(ResponseHead::new(status))), } } } #[inline] /// Release request instance - fn release(&self, msg: Box) { + fn release(&self, mut msg: Box) { let v = &mut self.0.borrow_mut(); if v.len() < 128 { - msg.extensions.borrow_mut().clear(); + msg.extensions.get_mut().clear(); v.push(msg); } } diff --git a/actix-http/src/response.rs b/actix-http/src/response.rs index df2f5be50..19feb5633 100644 --- a/actix-http/src/response.rs +++ b/actix-http/src/response.rs @@ -1,9 +1,6 @@ //! Http response use std::cell::{Ref, RefMut}; use std::convert::TryFrom; -use std::future::Future; -use std::pin::Pin; -use std::task::{Context, Poll}; use std::{fmt, str}; use bytes::{Bytes, BytesMut}; @@ -281,18 +278,6 @@ impl fmt::Debug for Response { } } -impl Future for Response { - type Output = Result; - - fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { - Poll::Ready(Ok(Response { - head: self.head.take(), - body: self.body.take_body(), - error: self.error.take(), - })) - } -} - pub struct CookieIter<'a> { iter: header::GetAll<'a>, } @@ -756,14 +741,6 @@ impl<'a> From<&'a ResponseHead> for ResponseBuilder { } } -impl Future for ResponseBuilder { - type Output = Result; - - fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { - Poll::Ready(Ok(self.finish())) - } -} - impl fmt::Debug for ResponseBuilder { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let head = self.head.as_ref().unwrap();