diff options
| author | Yuki Okushi <huyuumi.dev+love@gmail.com> | 2022-11-07 09:46:26 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-07 09:46:26 +0900 |
| commit | 57daec59895cc24548cdb56706fab66690cffb57 (patch) | |
| tree | b5bb7b801863146e1b4b9426d54f91c2d4be69ca /library/alloc/src | |
| parent | 06e261aaf57e49c5650513f5ab262c20f1e7ebfe (diff) | |
| parent | 743726e352b41ea6a8370ab16cd81152b3b28a53 (diff) | |
| download | rust-57daec59895cc24548cdb56706fab66690cffb57.tar.gz rust-57daec59895cc24548cdb56706fab66690cffb57.zip | |
Rollup merge of #104056 - ripytide:patch-1, r=Mark-Simulacrum
Vec: IntoIterator signature consistency Also makes the code dryer.
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 6 |
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() } } |
