We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
StatusCode::as_u16
1 parent 2c8db78 commit 072fd8aCopy full SHA for 072fd8a
src/status.rs
@@ -116,8 +116,8 @@ impl StatusCode {
116
/// assert_eq!(status.as_u16(), 200);
117
/// ```
118
#[inline]
119
- pub fn as_u16(&self) -> u16 {
120
- (*self).into()
+ pub const fn as_u16(&self) -> u16 {
+ (*self).0.get()
121
}
122
123
/// Returns a &str representation of the `StatusCode`
src/uri/port.rs
@@ -22,7 +22,7 @@ impl<T> Port<T> {
22
/// let port = authority.port().unwrap();
23
/// assert_eq!(port.as_u16(), 80);
24
25
26
self.port
27
28
0 commit comments