Skip to content

const fn for StatusCode::as_u16 #665

@y-haidar

Description

@y-haidar

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()
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions