diff options
| author | bors <bors@rust-lang.org> | 2015-06-08 16:09:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-06-08 16:09:56 +0000 |
| commit | 4a397dd33dad52ca0e66bd5cdfc3b6d049a9ce12 (patch) | |
| tree | 246f9d505f4ad28199dada882a833301365622d5 /src/libcollections/linked_list.rs | |
| parent | 61c43b47338b92c447c1f6af5cffec46718e750b (diff) | |
| parent | b36ed7d2edf68453c0344eb3cd55281e48c96ecb (diff) | |
| download | rust-4a397dd33dad52ca0e66bd5cdfc3b6d049a9ce12.tar.gz rust-4a397dd33dad52ca0e66bd5cdfc3b6d049a9ce12.zip | |
Auto merge of #25989 - jooert:implement_rfc839, r=Gankro
I had to use `impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap<V>` instead of `impl<'a, V: Copy> Extend<(&'a usize, &'a V)> for VecMap<V>` as that's what is needed for doing ```rust let mut a = VecMap::new(); let b = VecMap::new(); b.insert(1, "foo"); a.extend(&b) ``` I can squash the commits after review. r? @Gankro
Diffstat (limited to 'src/libcollections/linked_list.rs')
| -rw-r--r-- | src/libcollections/linked_list.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 980fe00f1e5..9ed129ccbe9 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -904,6 +904,13 @@ impl<A> Extend<A> for LinkedList<A> { } } +#[stable(feature = "extend_ref", since = "1.2.0")] +impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> { + fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) { + self.extend(iter.into_iter().cloned()); + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<A: PartialEq> PartialEq for LinkedList<A> { fn eq(&self, other: &LinkedList<A>) -> bool { |
