From 496ee8d0395d8ac7714b6c60d012e6e6283e8422 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 5 Mar 2019 18:14:30 -0800 Subject: [PATCH] remove more MessageBody constraints from Response --- src/response.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/response.rs b/src/response.rs index 8d32570a5..277890e40 100644 --- a/src/response.rs +++ b/src/response.rs @@ -212,7 +212,7 @@ impl Response { } /// Set a body - pub(crate) fn set_body(self, body: B2) -> Response { + pub(crate) fn set_body(self, body: B2) -> Response { Response { head: self.head, body: ResponseBody::Body(body), @@ -230,10 +230,7 @@ impl Response { } /// Set a body and return previous body value - pub(crate) fn replace_body( - self, - body: B2, - ) -> (Response, ResponseBody) { + pub(crate) fn replace_body(self, body: B2) -> (Response, ResponseBody) { ( Response { head: self.head, @@ -245,7 +242,7 @@ impl Response { } /// Set a body and return previous body value - pub fn map_body(mut self, f: F) -> Response + pub fn map_body(mut self, f: F) -> Response where F: FnOnce(&mut ResponseHead, ResponseBody) -> ResponseBody, { @@ -597,7 +594,7 @@ impl ResponseBuilder { /// Set a body and generate `Response`. /// /// `ResponseBuilder` can not be used after this call. - pub fn message_body(&mut self, body: B) -> Response { + pub fn message_body(&mut self, body: B) -> Response { if let Some(e) = self.err.take() { return Response::from(Error::from(e)).into_body(); }