diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-10-27 00:40:09 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-10-27 01:45:31 +0200 |
| commit | 5dc9db541e810839f4193fee43c62ebefbe6f260 (patch) | |
| tree | c87fe7d3a22d153493075c03b2106832ed445519 | |
| parent | 2411be5cae59e2640a9795c7301f66fb47325cce (diff) | |
| download | rust-5dc9db541e810839f4193fee43c62ebefbe6f260.tar.gz rust-5dc9db541e810839f4193fee43c62ebefbe6f260.zip | |
vec: Remove the Vec specialization for .extend()
This now produces as good code (with optimizations) using the TrustedLen codepath.
| -rw-r--r-- | src/libcollections/vec.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index c42926b0952..16331960cc1 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -76,7 +76,6 @@ use core::ptr; use core::ptr::Shared; use core::slice; -use super::SpecExtend; use super::range::RangeArgument; /// A contiguous growable array type, written `Vec<T>` but pronounced 'vector.' @@ -1554,22 +1553,10 @@ impl<'a, T> IntoIterator for &'a mut Vec<T> { impl<T> Extend<T> for Vec<T> { #[inline] fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) { - <Self as SpecExtend<I>>::spec_extend(self, iter); - } -} - -impl<I: IntoIterator> SpecExtend<I> for Vec<I::Item> { - default fn spec_extend(&mut self, iter: I) { self.extend_desugared(iter.into_iter()) } } -impl<T> SpecExtend<Vec<T>> for Vec<T> { - fn spec_extend(&mut self, ref mut other: Vec<T>) { - self.append(other); - } -} - trait IsTrustedLen : Iterator { fn trusted_len(&self) -> Option<usize> { None } } |
