diff --git a/actix-files/src/files.rs b/actix-files/src/files.rs index b2d69612c..25706a232 100644 --- a/actix-files/src/files.rs +++ b/actix-files/src/files.rs @@ -84,7 +84,7 @@ impl Files { /// /// `Files` utilizes the existing Tokio thread-pool for blocking filesystem operations. /// The number of running threads is adjusted over time as needed, up to a maximum of 512 times - /// the number of server [workers](HttpServer::workers), by default. + /// the number of server [workers](actix_web::HttpServer::workers), by default. pub fn new>(mount_path: &str, serve_from: T) -> Files { let orig_dir = serve_from.into(); let dir = match orig_dir.canonicalize() { diff --git a/actix-http/src/response.rs b/actix-http/src/response.rs index 1b3f68505..4f603956e 100644 --- a/actix-http/src/response.rs +++ b/actix-http/src/response.rs @@ -20,7 +20,6 @@ use crate::{ pub struct Response { pub(crate) head: BoxedResponseHead, pub(crate) body: B, - pub(crate) error: Option, } impl Response { @@ -30,7 +29,6 @@ impl Response { Response { head: BoxedResponseHead::new(status), body: Body::Empty, - error: None, } } @@ -72,11 +70,10 @@ impl Response { /// Constructs a new response from an error. #[inline] pub fn from_error(error: Error) -> Response { - let mut resp = error.as_response_error().error_response(); + let resp = error.as_response_error().error_response(); if resp.head.status == StatusCode::INTERNAL_SERVER_ERROR { debug!("Internal Server Error: {:?}", error); } - resp.error = Some(error); resp } } @@ -88,7 +85,6 @@ impl Response { Response { head: BoxedResponseHead::new(status), body: body, - error: None, } } @@ -104,12 +100,6 @@ impl Response { &mut *self.head } - /// Returns the source `error` for this response, if one is set. - #[inline] - pub fn error(&self) -> Option<&Error> { - self.error.as_ref() - } - /// Returns the status code of this response. #[inline] pub fn status(&self) -> StatusCode { @@ -168,7 +158,6 @@ impl Response { Response { head: self.head, body, - error: None, } } @@ -183,7 +172,6 @@ impl Response { Response { head: self.head, body, - error: self.error, }, self.body, ) @@ -208,7 +196,6 @@ impl Response { Response { head: self.head, body, - error: self.error, } } diff --git a/actix-http/src/response_builder.rs b/actix-http/src/response_builder.rs index 3fb94dad5..df9079d70 100644 --- a/actix-http/src/response_builder.rs +++ b/actix-http/src/response_builder.rs @@ -248,13 +248,8 @@ impl ResponseBuilder { return Err(err.into()); } - let response = self.head.take().expect("cannot reuse response builder"); - - Ok(Response { - head: response, - body, - error: None, - }) + let head = self.head.take().expect("cannot reuse response builder"); + Ok(Response { head, body }) } /// Generate response with a streaming body.