We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ReasonPhrase::from_static
1 parent 4021c57 commit d4a61e3Copy full SHA for d4a61e3
src/ext/h1_reason_phrase.rs
@@ -42,7 +42,7 @@ impl ReasonPhrase {
42
}
43
44
/// Converts a static byte slice to a reason phrase.
45
- pub fn from_static(reason: &'static [u8]) -> Self {
+ pub const fn from_static(reason: &'static [u8]) -> Self {
46
// TODO: this can be made const once MSRV is >= 1.57.0
47
if find_invalid_byte(reason).is_some() {
48
panic!("invalid byte in static reason phrase");
0 commit comments