diff --git a/src/ext/h1_reason_phrase.rs b/src/ext/h1_reason_phrase.rs index 28c19984d5..62173baa72 100644 --- a/src/ext/h1_reason_phrase.rs +++ b/src/ext/h1_reason_phrase.rs @@ -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");