change Response::status() to return StatusCode by value

This commit is contained in:
Sean McArthur
2017-06-07 18:11:05 -07:00
parent 583fceb51f
commit cb9a45b8a4

View File

@@ -56,11 +56,11 @@ impl Response {
/// Get the `StatusCode`. /// Get the `StatusCode`.
#[inline] #[inline]
pub fn status(&self) -> &StatusCode { pub fn status(&self) -> StatusCode {
match self.inner { match self.inner {
Decoder::PlainText(ref hyper_response) => &hyper_response.status, Decoder::PlainText(ref hyper_response) => hyper_response.status,
Decoder::Gzip { ref head, .. } | Decoder::Gzip { ref head, .. } |
Decoder::Errored { ref head, .. } => &head.status, Decoder::Errored { ref head, .. } => head.status,
} }
} }