Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const fn for StatusCode::as_u16 #665

Open
y-haidar opened this issue Jan 26, 2024 · 1 comment
Open

const fn for StatusCode::as_u16 #665

y-haidar opened this issue Jan 26, 2024 · 1 comment

Comments

@y-haidar
Copy link

Are there plans for this? Would like to use it in constant generics.

http/src/status.rs

Lines 119 to 121 in bda9320

pub fn as_u16(&self) -> u16 {
(*self).into()
}

Change to this:

    pub const fn as_u16(&self) -> u16 {
        (*self).0.get()
    }
WhyNotHugo added a commit to WhyNotHugo/http that referenced this issue Feb 21, 2024
@WhyNotHugo
Copy link

See: #680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants