Skip to content

Commit

Permalink
refactor(header): allow clippy::out_of_bounds_indexing to panic in co…
Browse files Browse the repository at this point in the history
…nst context workaround
  • Loading branch information
tottoto authored and seanmonstar committed May 6, 2024
1 parent 0636a42 commit f4e8c0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/header/name.rs
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/header/value.rs
Expand Up @@ -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;
Expand Down

0 comments on commit f4e8c0c

Please sign in to comment.