Skip to content

Commit f4e8c0c

Browse files
tottotoseanmonstar
authored andcommitted
refactor(header): allow clippy::out_of_bounds_indexing to panic in const context workaround
1 parent 0636a42 commit f4e8c0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/header/name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ impl HeaderName {
12741274
// https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html#panic-in-const-contexts
12751275
//
12761276
// See the panics section of this method's document for details.
1277-
#[allow(clippy::no_effect)]
1277+
#[allow(clippy::no_effect, clippy::out_of_bounds_indexing)]
12781278
([] as [u8; 0])[0]; // Invalid header name
12791279
}
12801280

src/header/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl HeaderValue {
9191
// https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html#panic-in-const-contexts
9292
//
9393
// See the panics section of this method's document for details.
94-
#[allow(clippy::no_effect)]
94+
#[allow(clippy::no_effect, clippy::out_of_bounds_indexing)]
9595
([] as [u8; 0])[0]; // Invalid header value
9696
}
9797
i += 1;

0 commit comments

Comments
 (0)