Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Disable two clippy warnings in `array_proxy.rs`

## [v0.23.1] - 2022-04-29

- GHA: rust dependency caching
Expand Down
3 changes: 2 additions & 1 deletion src/generate/array_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct ArrayProxy<T, const COUNT: usize, const STRIDE: usize> {
/// an ArrayProxy.
_array: marker::PhantomData<T>,
}

#[allow(clippy::len_without_is_empty)]
impl<T, const C: usize, const S: usize> ArrayProxy<T, C, S> {
/// Get a reference from an [ArrayProxy] with no bounds checking.
pub unsafe fn get_ref(&self, index: usize) -> &T {
Expand All @@ -40,6 +40,7 @@ impl<T, const C: usize, const S: usize> core::ops::Index<usize> for ArrayProxy<T
type Output = T;
fn index(&self, index: usize) -> &T {
// Do a real array dereference for the bounds check.
#[allow(clippy::no_effect)]
[(); C][index];
unsafe { self.get_ref(index) }
}
Expand Down