Rename Mask::from_int to Mask::from_simd

This commit is contained in:
okaneco 2025-09-05 14:30:44 -04:00
parent 1e62d4c87c
commit 42409f05bf
2 changed files with 2 additions and 2 deletions

View file

@ -204,7 +204,7 @@ where
#[inline]
#[must_use = "method returns a new mask and does not mutate the original value"]
#[track_caller]
pub fn from_int(value: Simd<T, N>) -> Self {
pub fn from_simd(value: Simd<T, N>) -> Self {
assert!(T::valid(value), "all values must be either 0 or -1",);
// Safety: the validity has been checked
unsafe { Self::from_int_unchecked(value) }

View file

@ -67,7 +67,7 @@ macro_rules! test_mask_api {
let mask = Mask::<$type, 8>::from_array(values);
let int = mask.to_simd();
assert_eq!(int.to_array(), [-1, 0, 0, -1, 0, 0, -1, 0]);
assert_eq!(Mask::<$type, 8>::from_int(int), mask);
assert_eq!(Mask::<$type, 8>::from_simd(int), mask);
}
#[test]