about summary refs log tree commit diff
path: root/src/libcollections/binary_heap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcollections/binary_heap.rs')
-rw-r--r--src/libcollections/binary_heap.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs
index 00e4002f82f..97bdd8e6a6e 100644
--- a/src/libcollections/binary_heap.rs
+++ b/src/libcollections/binary_heap.rs
@@ -760,3 +760,10 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
         }
     }
 }
+
+#[stable(feature = "extend_ref", since = "1.2.0")]
+impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BinaryHeap<T> {
+    fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
+        self.extend(iter.into_iter().cloned());
+    }
+}