From db7bd962cb927ece14dc18f7c270095a51ab9a93 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 19 Dec 2017 11:46:11 -0800 Subject: [PATCH] fix some doc strings --- src/httprequest.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/httprequest.rs b/src/httprequest.rs index 1944fc4d..4da687b0 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -223,7 +223,7 @@ impl HttpRequest { /// The target path of this Request. #[inline] pub fn path(&self) -> &str { - self.as_ref().uri.path() + self.uri().path() } /// Get *ConnectionInfo* for currect request. @@ -310,7 +310,7 @@ impl HttpRequest { /// E.g., id=10 #[inline] pub fn query_string(&self) -> &str { - if let Some(query) = self.as_ref().uri.query().as_ref() { + if let Some(query) = self.uri().query().as_ref() { query } else { "" @@ -355,7 +355,7 @@ impl HttpRequest { unsafe{ mem::transmute(&self.as_ref().params) } } - /// Set request Params. + /// Get mutable reference to request's Params. #[inline] pub(crate) fn match_info_mut(&mut self) -> &mut Params { unsafe{ mem::transmute(&mut self.as_mut().params) } @@ -366,7 +366,8 @@ impl HttpRequest { self.as_ref().keep_alive() } - /// Read the request content type + /// Read the request content type. If request does not contain + /// *Content-Type* header, empty str get returned. pub fn content_type(&self) -> &str { if let Some(content_type) = self.headers().get(header::CONTENT_TYPE) { if let Ok(content_type) = content_type.to_str() {