diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-10-20 20:49:58 -0400 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-10-20 20:49:58 -0400 |
| commit | 0f594090645912a7d2bd3e238de1e2a8afd83741 (patch) | |
| tree | 811d072a37f1c7a1b1f21c353abdbe0a2522dd12 | |
| parent | b962b612e02fb7a4585adf5f1753771687aa8e06 (diff) | |
| download | rust-0f594090645912a7d2bd3e238de1e2a8afd83741.tar.gz rust-0f594090645912a7d2bd3e238de1e2a8afd83741.zip | |
Change LANES to LEN and self.lanes() to self.len()
| -rw-r--r-- | crates/core_simd/src/vector.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs index 18a0bb0a77e..befbd71359c 100644 --- a/crates/core_simd/src/vector.rs +++ b/crates/core_simd/src/vector.rs @@ -112,7 +112,7 @@ where T: SimdElement, { /// Number of elements in this vector. - pub const LANES: usize = N; + pub const LEN: usize = N; /// Returns the number of elements in this SIMD vector. /// @@ -122,11 +122,11 @@ where /// # #![feature(portable_simd)] /// # use core::simd::u32x4; /// let v = u32x4::splat(0); - /// assert_eq!(v.lanes(), 4); + /// assert_eq!(v.len(), 4); /// ``` #[inline] - pub const fn lanes(&self) -> usize { - Self::LANES + pub const fn len(&self) -> usize { + Self::LEN } /// Constructs a new SIMD vector with all elements set to the given value. @@ -273,7 +273,7 @@ where #[track_caller] pub const fn from_slice(slice: &[T]) -> Self { assert!( - slice.len() >= Self::LANES, + slice.len() >= Self::LEN, "slice length must be at least the number of elements" ); // SAFETY: We just checked that the slice contains @@ -303,7 +303,7 @@ where #[track_caller] pub fn copy_to_slice(self, slice: &mut [T]) { assert!( - slice.len() >= Self::LANES, + slice.len() >= Self::LEN, "slice length must be at least the number of elements" ); // SAFETY: We just checked that the slice contains |
