summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorripytide <62516857+ripytide@users.noreply.github.com>2022-11-06 15:25:00 +0000
committerGitHub <noreply@github.com>2022-11-06 15:25:00 +0000
commit743726e352b41ea6a8370ab16cd81152b3b28a53 (patch)
tree413dfd7e7527afdd6f4ef7fc978759be693d3b3e /library/alloc/src/vec
parent534ddc6166a9031b0c269544929d68f2539ea7a0 (diff)
downloadrust-743726e352b41ea6a8370ab16cd81152b3b28a53.tar.gz
rust-743726e352b41ea6a8370ab16cd81152b3b28a53.zip
Vec: IntoIterator signature consistency
Also makes the code dryer.
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 834c8f58cb2..766006939fa 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2780,7 +2780,7 @@ impl<T, A: Allocator> IntoIterator for Vec<T, A> {
     /// assert_eq!(v_iter.next(), None);
     /// ```
     #[inline]
-    fn into_iter(self) -> IntoIter<T, A> {
+    fn into_iter(self) -> Self::IntoIter {
         unsafe {
             let mut me = ManuallyDrop::new(self);
             let alloc = ManuallyDrop::new(ptr::read(me.allocator()));
@@ -2808,7 +2808,7 @@ impl<'a, T, A: Allocator> IntoIterator for &'a Vec<T, A> {
     type Item = &'a T;
     type IntoIter = slice::Iter<'a, T>;
 
-    fn into_iter(self) -> slice::Iter<'a, T> {
+    fn into_iter(self) -> Self::IntoIter {
         self.iter()
     }
 }
@@ -2818,7 +2818,7 @@ impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> {
     type Item = &'a mut T;
     type IntoIter = slice::IterMut<'a, T>;
 
-    fn into_iter(self) -> slice::IterMut<'a, T> {
+    fn into_iter(self) -> Self::IntoIter {
         self.iter_mut()
     }
 }