diff options
Diffstat (limited to 'library/core/src/array/iter.rs')
| -rw-r--r-- | library/core/src/array/iter.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index 2b22488b8ff..e50ae1b0d70 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -1,6 +1,6 @@ //! Defines the `IntoIter` owned iterator for arrays. -use crate::num::NonZeroUsize; +use crate::num::NonZero; use crate::{ fmt, intrinsics::transmute_unchecked, @@ -280,7 +280,7 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> { self.next_back() } - fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { + fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> { // This also moves the start, which marks them as conceptually "dropped", // so if anything goes bad then our drop impl won't double-free them. let range_to_drop = self.alive.take_prefix(n); @@ -292,7 +292,7 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> { ptr::drop_in_place(MaybeUninit::slice_assume_init_mut(slice)); } - NonZeroUsize::new(remaining).map_or(Ok(()), Err) + NonZero::<usize>::new(remaining).map_or(Ok(()), Err) } #[inline] @@ -335,7 +335,7 @@ impl<T, const N: usize> DoubleEndedIterator for IntoIter<T, N> { }) } - fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { + fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>> { // This also moves the end, which marks them as conceptually "dropped", // so if anything goes bad then our drop impl won't double-free them. let range_to_drop = self.alive.take_suffix(n); @@ -347,7 +347,7 @@ impl<T, const N: usize> DoubleEndedIterator for IntoIter<T, N> { ptr::drop_in_place(MaybeUninit::slice_assume_init_mut(slice)); } - NonZeroUsize::new(remaining).map_or(Ok(()), Err) + NonZero::<usize>::new(remaining).map_or(Ok(()), Err) } } |
