diff --git a/src/status.rs b/src/status.rs index 16896e4a..9ad04d20 100644 --- a/src/status.rs +++ b/src/status.rs @@ -116,8 +116,8 @@ impl StatusCode { /// assert_eq!(status.as_u16(), 200); /// ``` #[inline] - pub fn as_u16(&self) -> u16 { - (*self).into() + pub const fn as_u16(&self) -> u16 { + (*self).0.get() } /// Returns a &str representation of the `StatusCode` diff --git a/src/uri/port.rs b/src/uri/port.rs index 8f5c5f3f..2a7028e2 100644 --- a/src/uri/port.rs +++ b/src/uri/port.rs @@ -22,7 +22,7 @@ impl Port { /// let port = authority.port().unwrap(); /// assert_eq!(port.as_u16(), 80); /// ``` - pub fn as_u16(&self) -> u16 { + pub const fn as_u16(&self) -> u16 { self.port } }