From f71354783e3d7d75fe9210fa612745be0a1588b3 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 5 Mar 2019 19:10:45 -0800 Subject: [PATCH] update HttpMessage impls --- src/request.rs | 5 ----- src/service.rs | 17 ++++++----------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/request.rs b/src/request.rs index 75daf59d8..211f60b85 100644 --- a/src/request.rs +++ b/src/request.rs @@ -117,11 +117,6 @@ impl HttpMessage for HttpRequest { &self.head().headers } - #[inline] - fn headers_mut(&mut self) -> &mut HeaderMap { - &mut self.head.headers - } - /// Request extensions #[inline] fn extensions(&self) -> Ref { diff --git a/src/service.rs b/src/service.rs index 0da664396..7d17527a4 100644 --- a/src/service.rs +++ b/src/service.rs @@ -78,6 +78,12 @@ impl

ServiceRequest

{ self.head().version } + #[inline] + /// Returns mutable Request's headers. + pub fn headers_mut(&mut self) -> &mut HeaderMap { + &mut self.head_mut().headers + } + /// The target path of this Request. #[inline] pub fn path(&self) -> &str { @@ -134,12 +140,6 @@ impl

HttpMessage for ServiceRequest

{ &self.head().headers } - #[inline] - /// Mutable reference to the request's headers. - fn headers_mut(&mut self) -> &mut HeaderMap { - &mut self.head_mut().headers - } - /// Request extensions #[inline] fn extensions(&self) -> Ref { @@ -230,11 +230,6 @@ impl

HttpMessage for ServiceFromRequest

{ self.req.headers() } - #[inline] - fn headers_mut(&mut self) -> &mut HeaderMap { - self.req.headers_mut() - } - /// Request extensions #[inline] fn extensions(&self) -> Ref {