Skip to content

Commit d4a61e3

Browse files
committed
feat(ext): make ReasonPhrase::from_static a const fn
1 parent 4021c57 commit d4a61e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ext/h1_reason_phrase.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl ReasonPhrase {
4242
}
4343

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

0 commit comments

Comments
 (0)