diff options
Diffstat (limited to 'src/libcollections/vec_map.rs')
| -rw-r--r-- | src/libcollections/vec_map.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index aa0ab41b745..8180f1d56df 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -828,6 +828,13 @@ impl<V> Extend<(usize, V)> for VecMap<V> { } } +#[stable(feature = "extend_ref", since = "1.2.0")] +impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap<V> { + fn extend<I: IntoIterator<Item=(usize, &'a V)>>(&mut self, iter: I) { + self.extend(iter.into_iter().map(|(key, &value)| (key, value))); + } +} + impl<V> Index<usize> for VecMap<V> { type Output = V; |
