Skip to content

Commit

Permalink
feat(ext): make ReasonPhrase::from_static a const fn
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Aug 24, 2023
1 parent 4021c57 commit d4a61e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ext/h1_reason_phrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ReasonPhrase {
}

/// Converts a static byte slice to a reason phrase.
pub fn from_static(reason: &'static [u8]) -> Self {
pub const fn from_static(reason: &'static [u8]) -> Self {
// TODO: this can be made const once MSRV is >= 1.57.0
if find_invalid_byte(reason).is_some() {
panic!("invalid byte in static reason phrase");
Expand Down

0 comments on commit d4a61e3

Please sign in to comment.