Skip to content

Commit

Permalink
Ignore clippy::out_of_bounds_indexing error
Browse files Browse the repository at this point in the history
```
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
```
  • Loading branch information
taiki-e committed Jan 7, 2024
1 parent 7c0376d commit 6345482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub(crate) const fn cast_ptr<T>(n: &T) -> *const T {
///
/// This is a workaround for the lack of panic-in-const in older
/// toolchains.
#[allow(unconditional_panic)]
#[allow(unconditional_panic, clippy::out_of_bounds_indexing)]
pub(crate) const fn unwrap_u32(t: Option<u32>) -> u32 {
match t {
Some(v) => v,
Expand All @@ -139,7 +139,7 @@ pub(crate) const fn unwrap_u32(t: Option<u32>) -> u32 {
///
/// This is a workaround for the lack of panic-in-const in older
/// toolchains.
#[allow(unconditional_panic)]
#[allow(unconditional_panic, clippy::out_of_bounds_indexing)]
pub(crate) const fn unwrap_nonzero(t: Option<NonZeroU32>) -> NonZeroU32 {
match t {
Some(v) => v,
Expand Down

0 comments on commit 6345482

Please sign in to comment.