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
650650 }
651651}
652652
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+
653677mod sealed {
654678 pub trait Sealed { }
655679}
You can’t perform that action at this time.
0 commit comments