From 98cd636d581962c29ca336ca89dce083dbed926f Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Wed, 2 Mar 2022 20:09:01 -0800 Subject: [PATCH] Add Mask::cast --- crates/core_simd/src/masks.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index e8962b86b118..8f2f3f6aee00 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -181,6 +181,13 @@ where self.0.to_int() } + /// Converts the mask to a mask of any other lane size. + #[inline] + #[must_use = "method returns a new mask and does not mutate the original value"] + pub fn cast(self) -> Mask { + Mask(self.0.convert()) + } + /// Tests the value of the specified lane. /// /// # Safety