@@ -624,7 +624,7 @@ impl<T> [T] {
624
624
/// not divide the length of the slice, then the last chunk will
625
625
/// not have length `chunk_size`.
626
626
///
627
- /// See [`exact_chunks `] for a variant of this iterator that returns chunks
627
+ /// See [`chunks_exact `] for a variant of this iterator that returns chunks
628
628
/// of always exactly `chunk_size` elements.
629
629
///
630
630
/// # Panics
@@ -642,7 +642,7 @@ impl<T> [T] {
642
642
/// assert!(iter.next().is_none());
643
643
/// ```
644
644
///
645
- /// [`exact_chunks `]: #method.exact_chunks
645
+ /// [`chunks_exact `]: #method.chunks_exact
646
646
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
647
647
#[ inline]
648
648
pub fn chunks ( & self , chunk_size : usize ) -> Chunks < T > {
@@ -655,7 +655,7 @@ impl<T> [T] {
655
655
/// not divide the length of the slice, then the last chunk will not
656
656
/// have length `chunk_size`.
657
657
///
658
- /// See [`exact_chunks_mut `] for a variant of this iterator that returns chunks
658
+ /// See [`chunks_exact_mut `] for a variant of this iterator that returns chunks
659
659
/// of always exactly `chunk_size` elements.
660
660
///
661
661
/// # Panics
@@ -677,7 +677,7 @@ impl<T> [T] {
677
677
/// assert_eq!(v, &[1, 1, 2, 2, 3]);
678
678
/// ```
679
679
///
680
- /// [`exact_chunks_mut `]: #method.exact_chunks_mut
680
+ /// [`chunks_exact_mut `]: #method.chunks_exact_mut
681
681
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
682
682
#[ inline]
683
683
pub fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < T > {
@@ -702,24 +702,24 @@ impl<T> [T] {
702
702
/// # Examples
703
703
///
704
704
/// ```
705
- /// #![feature(exact_chunks )]
705
+ /// #![feature(chunks_exact )]
706
706
///
707
707
/// let slice = ['l', 'o', 'r', 'e', 'm'];
708
- /// let mut iter = slice.exact_chunks (2);
708
+ /// let mut iter = slice.chunks_exact (2);
709
709
/// assert_eq!(iter.next().unwrap(), &['l', 'o']);
710
710
/// assert_eq!(iter.next().unwrap(), &['r', 'e']);
711
711
/// assert!(iter.next().is_none());
712
712
/// ```
713
713
///
714
714
/// [`chunks`]: #method.chunks
715
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
715
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
716
716
#[ inline]
717
- pub fn exact_chunks ( & self , chunk_size : usize ) -> ExactChunks < T > {
717
+ pub fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < T > {
718
718
assert ! ( chunk_size != 0 ) ;
719
719
let rem = self . len ( ) % chunk_size;
720
720
let len = self . len ( ) - rem;
721
721
let ( fst, snd) = self . split_at ( len) ;
722
- ExactChunks { v : fst, rem : snd, chunk_size }
722
+ ChunksExact { v : fst, rem : snd, chunk_size }
723
723
}
724
724
725
725
/// Returns an iterator over `chunk_size` elements of the slice at a time.
@@ -739,12 +739,12 @@ impl<T> [T] {
739
739
/// # Examples
740
740
///
741
741
/// ```
742
- /// #![feature(exact_chunks )]
742
+ /// #![feature(chunks_exact )]
743
743
///
744
744
/// let v = &mut [0, 0, 0, 0, 0];
745
745
/// let mut count = 1;
746
746
///
747
- /// for chunk in v.exact_chunks_mut (2) {
747
+ /// for chunk in v.chunks_exact_mut (2) {
748
748
/// for elem in chunk.iter_mut() {
749
749
/// *elem += count;
750
750
/// }
@@ -754,14 +754,14 @@ impl<T> [T] {
754
754
/// ```
755
755
///
756
756
/// [`chunks_mut`]: #method.chunks_mut
757
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
757
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
758
758
#[ inline]
759
- pub fn exact_chunks_mut ( & mut self , chunk_size : usize ) -> ExactChunksMut < T > {
759
+ pub fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < T > {
760
760
assert ! ( chunk_size != 0 ) ;
761
761
let rem = self . len ( ) % chunk_size;
762
762
let len = self . len ( ) - rem;
763
763
let ( fst, snd) = self . split_at_mut ( len) ;
764
- ExactChunksMut { v : fst, rem : snd, chunk_size }
764
+ ChunksExactMut { v : fst, rem : snd, chunk_size }
765
765
}
766
766
767
767
/// Divides one slice into two at an index.
@@ -3829,21 +3829,21 @@ unsafe impl<'a, T> TrustedRandomAccess for ChunksMut<'a, T> {
3829
3829
/// up to `chunk_size-1` elements will be omitted but can be retrieved from
3830
3830
/// the [`remainder`] function from the iterator.
3831
3831
///
3832
- /// This struct is created by the [`exact_chunks `] method on [slices].
3832
+ /// This struct is created by the [`chunks_exact `] method on [slices].
3833
3833
///
3834
- /// [`exact_chunks `]: ../../std/primitive.slice.html#method.exact_chunks
3835
- /// [`remainder`]: ../../std/slice/struct.ExactChunks .html#method.remainder
3834
+ /// [`chunks_exact `]: ../../std/primitive.slice.html#method.chunks_exact
3835
+ /// [`remainder`]: ../../std/slice/struct.ChunksExact .html#method.remainder
3836
3836
/// [slices]: ../../std/primitive.slice.html
3837
3837
#[ derive( Debug ) ]
3838
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3839
- pub struct ExactChunks < ' a , T : ' a > {
3838
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3839
+ pub struct ChunksExact < ' a , T : ' a > {
3840
3840
v : & ' a [ T ] ,
3841
3841
rem : & ' a [ T ] ,
3842
3842
chunk_size : usize
3843
3843
}
3844
3844
3845
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3846
- impl < ' a , T > ExactChunks < ' a , T > {
3845
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3846
+ impl < ' a , T > ChunksExact < ' a , T > {
3847
3847
/// Return the remainder of the original slice that is not going to be
3848
3848
/// returned by the iterator. The returned slice has at most `chunk_size-1`
3849
3849
/// elements.
@@ -3853,19 +3853,19 @@ impl<'a, T> ExactChunks<'a, T> {
3853
3853
}
3854
3854
3855
3855
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
3856
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3857
- impl < ' a , T > Clone for ExactChunks < ' a , T > {
3858
- fn clone ( & self ) -> ExactChunks < ' a , T > {
3859
- ExactChunks {
3856
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3857
+ impl < ' a , T > Clone for ChunksExact < ' a , T > {
3858
+ fn clone ( & self ) -> ChunksExact < ' a , T > {
3859
+ ChunksExact {
3860
3860
v : self . v ,
3861
3861
rem : self . rem ,
3862
3862
chunk_size : self . chunk_size ,
3863
3863
}
3864
3864
}
3865
3865
}
3866
3866
3867
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3868
- impl < ' a , T > Iterator for ExactChunks < ' a , T > {
3867
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3868
+ impl < ' a , T > Iterator for ChunksExact < ' a , T > {
3869
3869
type Item = & ' a [ T ] ;
3870
3870
3871
3871
#[ inline]
@@ -3909,8 +3909,8 @@ impl<'a, T> Iterator for ExactChunks<'a, T> {
3909
3909
}
3910
3910
}
3911
3911
3912
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3913
- impl < ' a , T > DoubleEndedIterator for ExactChunks < ' a , T > {
3912
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3913
+ impl < ' a , T > DoubleEndedIterator for ChunksExact < ' a , T > {
3914
3914
#[ inline]
3915
3915
fn next_back ( & mut self ) -> Option < & ' a [ T ] > {
3916
3916
if self . v . len ( ) < self . chunk_size {
@@ -3923,21 +3923,21 @@ impl<'a, T> DoubleEndedIterator for ExactChunks<'a, T> {
3923
3923
}
3924
3924
}
3925
3925
3926
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3927
- impl < ' a , T > ExactSizeIterator for ExactChunks < ' a , T > {
3926
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3927
+ impl < ' a , T > ExactSizeIterator for ChunksExact < ' a , T > {
3928
3928
fn is_empty ( & self ) -> bool {
3929
3929
self . v . is_empty ( )
3930
3930
}
3931
3931
}
3932
3932
3933
3933
#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
3934
- unsafe impl < ' a , T > TrustedLen for ExactChunks < ' a , T > { }
3934
+ unsafe impl < ' a , T > TrustedLen for ChunksExact < ' a , T > { }
3935
3935
3936
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3937
- impl < ' a , T > FusedIterator for ExactChunks < ' a , T > { }
3936
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3937
+ impl < ' a , T > FusedIterator for ChunksExact < ' a , T > { }
3938
3938
3939
3939
#[ doc( hidden) ]
3940
- unsafe impl < ' a , T > TrustedRandomAccess for ExactChunks < ' a , T > {
3940
+ unsafe impl < ' a , T > TrustedRandomAccess for ChunksExact < ' a , T > {
3941
3941
unsafe fn get_unchecked ( & mut self , i : usize ) -> & ' a [ T ] {
3942
3942
let start = i * self . chunk_size ;
3943
3943
from_raw_parts ( self . v . as_ptr ( ) . add ( start) , self . chunk_size )
@@ -3952,21 +3952,21 @@ unsafe impl<'a, T> TrustedRandomAccess for ExactChunks<'a, T> {
3952
3952
/// `chunk_size-1` elements will be omitted but can be retrieved from the
3953
3953
/// [`into_remainder`] function from the iterator.
3954
3954
///
3955
- /// This struct is created by the [`exact_chunks_mut `] method on [slices].
3955
+ /// This struct is created by the [`chunks_exact_mut `] method on [slices].
3956
3956
///
3957
- /// [`exact_chunks_mut `]: ../../std/primitive.slice.html#method.exact_chunks_mut
3958
- /// [`into_remainder`]: ../../std/slice/struct.ExactChunksMut .html#method.into_remainder
3957
+ /// [`chunks_exact_mut `]: ../../std/primitive.slice.html#method.chunks_exact_mut
3958
+ /// [`into_remainder`]: ../../std/slice/struct.ChunksExactMut .html#method.into_remainder
3959
3959
/// [slices]: ../../std/primitive.slice.html
3960
3960
#[ derive( Debug ) ]
3961
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3962
- pub struct ExactChunksMut < ' a , T : ' a > {
3961
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3962
+ pub struct ChunksExactMut < ' a , T : ' a > {
3963
3963
v : & ' a mut [ T ] ,
3964
3964
rem : & ' a mut [ T ] ,
3965
3965
chunk_size : usize
3966
3966
}
3967
3967
3968
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3969
- impl < ' a , T > ExactChunksMut < ' a , T > {
3968
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3969
+ impl < ' a , T > ChunksExactMut < ' a , T > {
3970
3970
/// Return the remainder of the original slice that is not going to be
3971
3971
/// returned by the iterator. The returned slice has at most `chunk_size-1`
3972
3972
/// elements.
@@ -3975,8 +3975,8 @@ impl<'a, T> ExactChunksMut<'a, T> {
3975
3975
}
3976
3976
}
3977
3977
3978
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
3979
- impl < ' a , T > Iterator for ExactChunksMut < ' a , T > {
3978
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
3979
+ impl < ' a , T > Iterator for ChunksExactMut < ' a , T > {
3980
3980
type Item = & ' a mut [ T ] ;
3981
3981
3982
3982
#[ inline]
@@ -4022,8 +4022,8 @@ impl<'a, T> Iterator for ExactChunksMut<'a, T> {
4022
4022
}
4023
4023
}
4024
4024
4025
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
4026
- impl < ' a , T > DoubleEndedIterator for ExactChunksMut < ' a , T > {
4025
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
4026
+ impl < ' a , T > DoubleEndedIterator for ChunksExactMut < ' a , T > {
4027
4027
#[ inline]
4028
4028
fn next_back ( & mut self ) -> Option < & ' a mut [ T ] > {
4029
4029
if self . v . len ( ) < self . chunk_size {
@@ -4038,21 +4038,21 @@ impl<'a, T> DoubleEndedIterator for ExactChunksMut<'a, T> {
4038
4038
}
4039
4039
}
4040
4040
4041
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
4042
- impl < ' a , T > ExactSizeIterator for ExactChunksMut < ' a , T > {
4041
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
4042
+ impl < ' a , T > ExactSizeIterator for ChunksExactMut < ' a , T > {
4043
4043
fn is_empty ( & self ) -> bool {
4044
4044
self . v . is_empty ( )
4045
4045
}
4046
4046
}
4047
4047
4048
4048
#[ unstable( feature = "trusted_len" , issue = "37572" ) ]
4049
- unsafe impl < ' a , T > TrustedLen for ExactChunksMut < ' a , T > { }
4049
+ unsafe impl < ' a , T > TrustedLen for ChunksExactMut < ' a , T > { }
4050
4050
4051
- #[ unstable( feature = "exact_chunks " , issue = "47115" ) ]
4052
- impl < ' a , T > FusedIterator for ExactChunksMut < ' a , T > { }
4051
+ #[ unstable( feature = "chunks_exact " , issue = "47115" ) ]
4052
+ impl < ' a , T > FusedIterator for ChunksExactMut < ' a , T > { }
4053
4053
4054
4054
#[ doc( hidden) ]
4055
- unsafe impl < ' a , T > TrustedRandomAccess for ExactChunksMut < ' a , T > {
4055
+ unsafe impl < ' a , T > TrustedRandomAccess for ChunksExactMut < ' a , T > {
4056
4056
unsafe fn get_unchecked ( & mut self , i : usize ) -> & ' a mut [ T ] {
4057
4057
let start = i * self . chunk_size ;
4058
4058
from_raw_parts_mut ( self . v . as_mut_ptr ( ) . add ( start) , self . chunk_size )
0 commit comments