Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Jun 5, 2024
1 parent 3733375 commit bd92b7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/core_simd/src/swizzle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ where
#[inline]
#[must_use = "method returns a new vector and does not mutate the original inputs"]
pub fn interleave(self, other: Self) -> (Self, Self) {
// Safety: swizzles are safe for masks
let (lo, hi) = self.to_int().interleave(other.to_int());
// Safety: swizzles are safe for masks
unsafe { (Self::from_int_unchecked(lo), Self::from_int_unchecked(hi)) }
}

Expand Down Expand Up @@ -502,8 +502,8 @@ where
#[inline]
#[must_use = "method returns a new vector and does not mutate the original inputs"]
pub fn deinterleave(self, other: Self) -> (Self, Self) {
// Safety: swizzles are safe for masks
let (even, odd) = self.to_int().deinterleave(other.to_int());
// Safety: swizzles are safe for masks
unsafe {
(
Self::from_int_unchecked(even),
Expand Down
7 changes: 7 additions & 0 deletions crates/core_simd/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ where
///
/// When the element is disabled, that memory location is not accessed and the corresponding
/// value from `or` is passed through.
///
/// # Safety
/// Enabled loads must not exceed the length of `slice`.
#[must_use]
#[inline]
pub unsafe fn load_select_unchecked(
Expand All @@ -459,6 +462,9 @@ where
///
/// When the element is disabled, that memory location is not accessed and the corresponding
/// value from `or` is passed through.
///
/// # Safety
/// Enabled `ptr` elements must be safe to read as if by `std::ptr::read`.
#[must_use]
#[inline]
pub unsafe fn load_select_ptr(
Expand Down Expand Up @@ -1214,6 +1220,7 @@ fn lane_indices<const N: usize>() -> Simd<usize, N>
where
LaneCount<N>: SupportedLaneCount,
{
#![allow(clippy::needless_range_loop)]
let mut index = [0; N];
for i in 0..N {
index[i] = i;
Expand Down

0 comments on commit bd92b7c

Please sign in to comment.