@@ -25,7 +25,7 @@ use crate::Ix1;
2525use super :: { NdProducer , RemoveAxis } ;
2626
2727pub use self :: chunks:: { ExactChunks , ExactChunksIter , ExactChunksIterMut , ExactChunksMut } ;
28- pub use self :: lanes:: { Lanes , LanesMut } ;
28+ pub use self :: lanes:: { Lanes , LanesMut , LanesIter , LanesIterMut } ;
2929pub use self :: windows:: Windows ;
3030pub use self :: into_iter:: IntoIter ;
3131pub ( crate ) use self :: trusted:: { TrustedIterator , to_vec, to_vec_mapped} ;
@@ -744,94 +744,6 @@ where
744744 }
745745}
746746
747- /// An iterator that traverses over all axes but one, and yields a view for
748- /// each lane along that axis.
749- ///
750- /// See [`.lanes()`](../struct.ArrayBase.html#method.lanes) for more information.
751- pub struct LanesIter < ' a , A , D > {
752- inner_len : Ix ,
753- inner_stride : Ixs ,
754- iter : Baseiter < A , D > ,
755- life : PhantomData < & ' a A > ,
756- }
757-
758- clone_bounds ! (
759- [ ' a, A , D : Clone ]
760- LanesIter [ ' a, A , D ] {
761- @copy {
762- inner_len,
763- inner_stride,
764- life,
765- }
766- iter,
767- }
768- ) ;
769-
770- impl < ' a , A , D > Iterator for LanesIter < ' a , A , D >
771- where
772- D : Dimension ,
773- {
774- type Item = ArrayView < ' a , A , Ix1 > ;
775- fn next ( & mut self ) -> Option < Self :: Item > {
776- self . iter . next ( ) . map ( |ptr| unsafe {
777- ArrayView :: new_ ( ptr, Ix1 ( self . inner_len ) , Ix1 ( self . inner_stride as Ix ) )
778- } )
779- }
780-
781- fn size_hint ( & self ) -> ( usize , Option < usize > ) {
782- self . iter . size_hint ( )
783- }
784- }
785-
786- impl < ' a , A , D > ExactSizeIterator for LanesIter < ' a , A , D >
787- where
788- D : Dimension ,
789- {
790- fn len ( & self ) -> usize {
791- self . iter . len ( )
792- }
793- }
794-
795- // NOTE: LanesIterMut is a mutable iterator and must not expose aliasing
796- // pointers. Due to this we use an empty slice for the raw data (it's unused
797- // anyway).
798- /// An iterator that traverses over all dimensions but the innermost,
799- /// and yields each inner row (mutable).
800- ///
801- /// See [`.lanes_mut()`](../struct.ArrayBase.html#method.lanes_mut)
802- /// for more information.
803- pub struct LanesIterMut < ' a , A , D > {
804- inner_len : Ix ,
805- inner_stride : Ixs ,
806- iter : Baseiter < A , D > ,
807- life : PhantomData < & ' a mut A > ,
808- }
809-
810- impl < ' a , A , D > Iterator for LanesIterMut < ' a , A , D >
811- where
812- D : Dimension ,
813- {
814- type Item = ArrayViewMut < ' a , A , Ix1 > ;
815- fn next ( & mut self ) -> Option < Self :: Item > {
816- self . iter . next ( ) . map ( |ptr| unsafe {
817- ArrayViewMut :: new_ ( ptr, Ix1 ( self . inner_len ) , Ix1 ( self . inner_stride as Ix ) )
818- } )
819- }
820-
821- fn size_hint ( & self ) -> ( usize , Option < usize > ) {
822- self . iter . size_hint ( )
823- }
824- }
825-
826- impl < ' a , A , D > ExactSizeIterator for LanesIterMut < ' a , A , D >
827- where
828- D : Dimension ,
829- {
830- fn len ( & self ) -> usize {
831- self . iter . len ( )
832- }
833- }
834-
835747#[ derive( Debug ) ]
836748struct AxisIterCore < A , D > {
837749 /// Index along the axis of the value of `.next()`, relative to the start
0 commit comments