Replace IntoIter::new with IntoIterator::into_iter in std

This commit is contained in:
Muhammad Mominul Huque
2021-05-30 23:16:45 +06:00
parent d20b9add05
commit 01d4d46f66
5 changed files with 39 additions and 40 deletions

View File

@@ -416,7 +416,7 @@ impl<T, const N: usize> [T; N] {
{
// SAFETY: we know for certain that this iterator will yield exactly `N`
// items.
unsafe { collect_into_array_unchecked(&mut IntoIter::new(self).map(f)) }
unsafe { collect_into_array_unchecked(&mut IntoIterator::into_iter(self).map(f)) }
}
/// 'Zips up' two arrays into a single array of pairs.
@@ -437,7 +437,7 @@ impl<T, const N: usize> [T; N] {
/// ```
#[unstable(feature = "array_zip", issue = "80094")]
pub fn zip<U>(self, rhs: [U; N]) -> [(T, U); N] {
let mut iter = IntoIter::new(self).zip(IntoIter::new(rhs));
let mut iter = IntoIterator::into_iter(self).zip(rhs);
// SAFETY: we know for certain that this iterator will yield exactly `N`
// items.