Skip to content

Commit f99b7a5

Browse files
Merge #604
604: style: disable two clippy warnings in array_proxy r=burrbull a=duskmoon314 - Don't check `is_empty` on `ArrayProxy` - Don't check effect of `[(); C][index]` in `Index` trait Co-authored-by: Campbell He <[email protected]>
2 parents cf104f2 + 01b9cff commit f99b7a5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
- Disable two clippy warnings in `array_proxy.rs`
11+
1012
## [v0.23.1] - 2022-04-29
1113

1214
- GHA: rust dependency caching

src/generate/array_proxy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct ArrayProxy<T, const COUNT: usize, const STRIDE: usize> {
1313
/// an ArrayProxy.
1414
_array: marker::PhantomData<T>,
1515
}
16-
16+
#[allow(clippy::len_without_is_empty)]
1717
impl<T, const C: usize, const S: usize> ArrayProxy<T, C, S> {
1818
/// Get a reference from an [ArrayProxy] with no bounds checking.
1919
pub unsafe fn get_ref(&self, index: usize) -> &T {
@@ -40,6 +40,7 @@ impl<T, const C: usize, const S: usize> core::ops::Index<usize> for ArrayProxy<T
4040
type Output = T;
4141
fn index(&self, index: usize) -> &T {
4242
// Do a real array dereference for the bounds check.
43+
#[allow(clippy::no_effect)]
4344
[(); C][index];
4445
unsafe { self.get_ref(index) }
4546
}

0 commit comments

Comments
 (0)