Skip to content

Commit 2d68d7b

Browse files
authored
Ignore clippy::out_of_bounds_indexing error (#252)
``` error: index is out of bounds --> src/util.rs:134:17 | 134 | None => [][1], | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#out_of_bounds_indexing = note: `#[deny(clippy::out_of_bounds_indexing)]` on by default error: index is out of bounds --> src/util.rs:146:17 | 146 | None => [][1], | ^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#out_of_bounds_indexing ```
1 parent 7c0376d commit 2d68d7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub(crate) const fn cast_ptr<T>(n: &T) -> *const T {
127127
///
128128
/// This is a workaround for the lack of panic-in-const in older
129129
/// toolchains.
130-
#[allow(unconditional_panic)]
130+
#[allow(unconditional_panic, clippy::out_of_bounds_indexing)]
131131
pub(crate) const fn unwrap_u32(t: Option<u32>) -> u32 {
132132
match t {
133133
Some(v) => v,
@@ -139,7 +139,7 @@ pub(crate) const fn unwrap_u32(t: Option<u32>) -> u32 {
139139
///
140140
/// This is a workaround for the lack of panic-in-const in older
141141
/// toolchains.
142-
#[allow(unconditional_panic)]
142+
#[allow(unconditional_panic, clippy::out_of_bounds_indexing)]
143143
pub(crate) const fn unwrap_nonzero(t: Option<NonZeroU32>) -> NonZeroU32 {
144144
match t {
145145
Some(v) => v,

0 commit comments

Comments
 (0)