diff --git a/src/header/name.rs b/src/header/name.rs index 317bb8cf..e00e229d 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -1269,6 +1269,12 @@ impl HeaderName { i += 1; } } { + // TODO: When msrv is bumped to larger than 1.57, this should be + // replaced with `panic!` macro. + // https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html#panic-in-const-contexts + // + // See the panics section of this method's document for details. + #[allow(clippy::no_effect)] ([] as [u8; 0])[0]; // Invalid header name } diff --git a/src/header/value.rs b/src/header/value.rs index 509c4805..fb2a5c33 100644 --- a/src/header/value.rs +++ b/src/header/value.rs @@ -86,6 +86,12 @@ impl HeaderValue { let mut i = 0; while i < bytes.len() { if !is_visible_ascii(bytes[i]) { + // TODO: When msrv is bumped to larger than 1.57, this should be + // replaced with `panic!` macro. + // https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html#panic-in-const-contexts + // + // See the panics section of this method's document for details. + #[allow(clippy::no_effect)] ([] as [u8; 0])[0]; // Invalid header value } i += 1;