summary refs log tree commit diff
path: root/src/libcollections/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-06-08 16:09:56 +0000
committerbors <bors@rust-lang.org>2015-06-08 16:09:56 +0000
commit4a397dd33dad52ca0e66bd5cdfc3b6d049a9ce12 (patch)
tree246f9d505f4ad28199dada882a833301365622d5 /src/libcollections/string.rs
parent61c43b47338b92c447c1f6af5cffec46718e750b (diff)
parentb36ed7d2edf68453c0344eb3cd55281e48c96ecb (diff)
downloadrust-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/string.rs')
-rw-r--r--src/libcollections/string.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 7edcf3d3c9a..76f7c9c6b17 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -793,6 +793,13 @@ impl Extend<char> for String {
     }
 }
 
+#[stable(feature = "extend_ref", since = "1.2.0")]
+impl<'a> Extend<&'a char> for String {
+    fn extend<I: IntoIterator<Item=&'a char>>(&mut self, iter: I) {
+        self.extend(iter.into_iter().cloned());
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a> Extend<&'a str> for String {
     fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {