From 038c483339e11232e3d6b05900da24978f8b84fa Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 4 May 2024 11:34:01 +0900 Subject: [PATCH] refactor(header): allow clippy::out_of_bounds_indexing to panic in const context workaround --- src/header/name.rs | 2 +- src/header/value.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/header/name.rs b/src/header/name.rs index 64a276ae..41320262 100644 --- a/src/header/name.rs +++ b/src/header/name.rs @@ -1274,7 +1274,7 @@ impl HeaderName { // 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)] + #[allow(clippy::no_effect, clippy::out_of_bounds_indexing)] ([] as [u8; 0])[0]; // Invalid header name } diff --git a/src/header/value.rs b/src/header/value.rs index b7978cac..4813f6fd 100644 --- a/src/header/value.rs +++ b/src/header/value.rs @@ -91,7 +91,7 @@ impl HeaderValue { // 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)] + #[allow(clippy::no_effect, clippy::out_of_bounds_indexing)] ([] as [u8; 0])[0]; // Invalid header value } i += 1;