File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -650,6 +650,30 @@ where
650
650
}
651
651
}
652
652
653
+ impl < T , const LANES : usize > TryFrom < & [ T ] > for Simd < T , LANES >
654
+ where
655
+ LaneCount < LANES > : SupportedLaneCount ,
656
+ T : SimdElement ,
657
+ {
658
+ type Error = core:: array:: TryFromSliceError ;
659
+
660
+ fn try_from ( slice : & [ T ] ) -> Result < Self , Self :: Error > {
661
+ Ok ( Self :: from_array ( slice. try_into ( ) ?) )
662
+ }
663
+ }
664
+
665
+ impl < T , const LANES : usize > TryFrom < & mut [ T ] > for Simd < T , LANES >
666
+ where
667
+ LaneCount < LANES > : SupportedLaneCount ,
668
+ T : SimdElement ,
669
+ {
670
+ type Error = core:: array:: TryFromSliceError ;
671
+
672
+ fn try_from ( slice : & mut [ T ] ) -> Result < Self , Self :: Error > {
673
+ Ok ( Self :: from_array ( slice. try_into ( ) ?) )
674
+ }
675
+ }
676
+
653
677
mod sealed {
654
678
pub trait Sealed { }
655
679
}
You can’t perform that action at this time.
0 commit comments