feat(client): Response.status() now returns a StatusCode
Previously, it would return `&StatusCode`. Returning a reference was actually bigger than the enum itself, and prevented using `Into` on the return result directly. BREAKING CHANGE: If you were explicitly checking the status, such as with an equality comparison, you will need to use the value instead of a reference.
This commit is contained in:
@@ -36,7 +36,7 @@ impl<B> Request<B> {
|
||||
|
||||
/// Read the Request Version.
|
||||
#[inline]
|
||||
pub fn version(&self) -> &HttpVersion { &self.version }
|
||||
pub fn version(&self) -> HttpVersion { self.version }
|
||||
|
||||
/// Read the Request headers.
|
||||
#[inline]
|
||||
|
||||
@@ -37,7 +37,7 @@ impl Response {
|
||||
|
||||
/// Get the status from the server.
|
||||
#[inline]
|
||||
pub fn status(&self) -> &status::StatusCode { &self.status }
|
||||
pub fn status(&self) -> status::StatusCode { self.status }
|
||||
|
||||
/// Get the raw status code and reason.
|
||||
#[inline]
|
||||
@@ -45,7 +45,7 @@ impl Response {
|
||||
|
||||
/// Get the HTTP version of this response from the server.
|
||||
#[inline]
|
||||
pub fn version(&self) -> &version::HttpVersion { &self.version }
|
||||
pub fn version(&self) -> version::HttpVersion { self.version }
|
||||
|
||||
/// Take the `Body` of this response.
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user