1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 08:22:59 +01:00

fix some doc strings

This commit is contained in:
Nikolay Kim 2017-12-19 11:46:11 -08:00
parent f858fa7a32
commit db7bd962cb

View File

@ -223,7 +223,7 @@ impl<S> HttpRequest<S> {
/// The target path of this Request. /// The target path of this Request.
#[inline] #[inline]
pub fn path(&self) -> &str { pub fn path(&self) -> &str {
self.as_ref().uri.path() self.uri().path()
} }
/// Get *ConnectionInfo* for currect request. /// Get *ConnectionInfo* for currect request.
@ -310,7 +310,7 @@ impl<S> HttpRequest<S> {
/// E.g., id=10 /// E.g., id=10
#[inline] #[inline]
pub fn query_string(&self) -> &str { 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 query
} else { } else {
"" ""
@ -355,7 +355,7 @@ impl<S> HttpRequest<S> {
unsafe{ mem::transmute(&self.as_ref().params) } unsafe{ mem::transmute(&self.as_ref().params) }
} }
/// Set request Params. /// Get mutable reference to request's Params.
#[inline] #[inline]
pub(crate) fn match_info_mut(&mut self) -> &mut Params { pub(crate) fn match_info_mut(&mut self) -> &mut Params {
unsafe{ mem::transmute(&mut self.as_mut().params) } unsafe{ mem::transmute(&mut self.as_mut().params) }
@ -366,7 +366,8 @@ impl<S> HttpRequest<S> {
self.as_ref().keep_alive() 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 { pub fn content_type(&self) -> &str {
if let Some(content_type) = self.headers().get(header::CONTENT_TYPE) { if let Some(content_type) = self.headers().get(header::CONTENT_TYPE) {
if let Ok(content_type) = content_type.to_str() { if let Ok(content_type) = content_type.to_str() {