Skip to content

Commit 743726e

Browse files
authored
Vec: IntoIterator signature consistency
Also makes the code dryer.
1 parent 534ddc6 commit 743726e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/alloc/src/vec/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ impl<T, A: Allocator> IntoIterator for Vec<T, A> {
27802780
/// assert_eq!(v_iter.next(), None);
27812781
/// ```
27822782
#[inline]
2783-
fn into_iter(self) -> IntoIter<T, A> {
2783+
fn into_iter(self) -> Self::IntoIter {
27842784
unsafe {
27852785
let mut me = ManuallyDrop::new(self);
27862786
let alloc = ManuallyDrop::new(ptr::read(me.allocator()));
@@ -2808,7 +2808,7 @@ impl<'a, T, A: Allocator> IntoIterator for &'a Vec<T, A> {
28082808
type Item = &'a T;
28092809
type IntoIter = slice::Iter<'a, T>;
28102810

2811-
fn into_iter(self) -> slice::Iter<'a, T> {
2811+
fn into_iter(self) -> Self::IntoIter {
28122812
self.iter()
28132813
}
28142814
}
@@ -2818,7 +2818,7 @@ impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> {
28182818
type Item = &'a mut T;
28192819
type IntoIter = slice::IterMut<'a, T>;
28202820

2821-
fn into_iter(self) -> slice::IterMut<'a, T> {
2821+
fn into_iter(self) -> Self::IntoIter {
28222822
self.iter_mut()
28232823
}
28242824
}

0 commit comments

Comments
 (0)