Skip to content

Commit

Permalink
Allow using StatusCode::as_u16 in const contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyNotHugo committed Feb 21, 2024
1 parent 63102bc commit 4b8cc85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/status.rs
Expand Up @@ -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`
Expand Down

0 comments on commit 4b8cc85

Please sign in to comment.