@@ -12,7 +12,7 @@ use core::iter::{
1212} ;
1313use core:: marker:: PhantomData ;
1414use core:: mem:: { self , ManuallyDrop , MaybeUninit , SizedTypeProperties } ;
15- use core:: num:: NonZeroUsize ;
15+ use core:: num:: NonZero ;
1616#[ cfg( not( no_global_oom_handling) ) ]
1717use core:: ops:: Deref ;
1818use core:: ptr:: { self , NonNull } ;
@@ -234,7 +234,7 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
234234 }
235235
236236 #[ inline]
237- fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZeroUsize > {
237+ fn advance_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
238238 let step_size = self . len ( ) . min ( n) ;
239239 let to_drop = ptr:: slice_from_raw_parts_mut ( self . ptr . as_ptr ( ) , step_size) ;
240240 if T :: IS_ZST {
@@ -248,7 +248,7 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
248248 unsafe {
249249 ptr:: drop_in_place ( to_drop) ;
250250 }
251- NonZeroUsize :: new ( n - step_size) . map_or ( Ok ( ( ) ) , Err )
251+ NonZero :: new ( n - step_size) . map_or ( Ok ( ( ) ) , Err )
252252 }
253253
254254 #[ inline]
@@ -336,7 +336,7 @@ impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A> {
336336 }
337337
338338 #[ inline]
339- fn advance_back_by ( & mut self , n : usize ) -> Result < ( ) , NonZeroUsize > {
339+ fn advance_back_by ( & mut self , n : usize ) -> Result < ( ) , NonZero < usize > > {
340340 let step_size = self . len ( ) . min ( n) ;
341341 if T :: IS_ZST {
342342 // SAFETY: same as for advance_by()
@@ -350,7 +350,7 @@ impl<T, A: Allocator> DoubleEndedIterator for IntoIter<T, A> {
350350 unsafe {
351351 ptr:: drop_in_place ( to_drop) ;
352352 }
353- NonZeroUsize :: new ( n - step_size) . map_or ( Ok ( ( ) ) , Err )
353+ NonZero :: new ( n - step_size) . map_or ( Ok ( ( ) ) , Err )
354354 }
355355}
356356
@@ -457,8 +457,8 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for IntoIter<T, A> {
457457#[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
458458#[ doc( hidden) ]
459459unsafe impl < T , A : Allocator > InPlaceIterable for IntoIter < T , A > {
460- const EXPAND_BY : Option < NonZeroUsize > = NonZeroUsize :: new ( 1 ) ;
461- const MERGE_BY : Option < NonZeroUsize > = NonZeroUsize :: new ( 1 ) ;
460+ const EXPAND_BY : Option < NonZero < usize > > = NonZero :: new ( 1 ) ;
461+ const MERGE_BY : Option < NonZero < usize > > = NonZero :: new ( 1 ) ;
462462}
463463
464464#[ unstable( issue = "none" , feature = "inplace_iteration" ) ]
0 commit comments