File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -499,18 +499,30 @@ where
499
499
/// `padding` from the right.
500
500
#[ inline]
501
501
#[ must_use = "method returns a new mask and does not mutate the original inputs" ]
502
- pub fn shift_elements_left < const OFFSET : usize > ( self , padding : T ) -> Self {
502
+ pub fn shift_elements_left < const OFFSET : usize > ( self , padding : bool ) -> Self {
503
503
// Safety: swizzles are safe for masks
504
- unsafe { Self :: from_int_unchecked ( self . to_int ( ) . shift_elements_left :: < OFFSET > ( padding) ) }
504
+ unsafe {
505
+ Self :: from_int_unchecked ( self . to_int ( ) . shift_elements_left :: < OFFSET > ( if padding {
506
+ T :: TRUE
507
+ } else {
508
+ T :: FALSE
509
+ } ) )
510
+ }
505
511
}
506
512
507
513
/// Shifts the mask elements to the right by `OFFSET`, filling in with
508
514
/// `padding` from the left.
509
515
#[ inline]
510
516
#[ must_use = "method returns a new mask and does not mutate the original inputs" ]
511
- pub fn shift_elements_right < const OFFSET : usize > ( self , padding : T ) -> Self {
517
+ pub fn shift_elements_right < const OFFSET : usize > ( self , padding : bool ) -> Self {
512
518
// Safety: swizzles are safe for masks
513
- unsafe { Self :: from_int_unchecked ( self . to_int ( ) . shift_elements_right :: < OFFSET > ( padding) ) }
519
+ unsafe {
520
+ Self :: from_int_unchecked ( self . to_int ( ) . shift_elements_right :: < OFFSET > ( if padding {
521
+ T :: TRUE
522
+ } else {
523
+ T :: FALSE
524
+ } ) )
525
+ }
514
526
}
515
527
516
528
/// Interleave two masks.
You can’t perform that action at this time.
0 commit comments