We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cb40b8a + 8db906c commit 0dbbab9Copy full SHA for 0dbbab9
src/libcollections/binary_heap.rs
@@ -154,6 +154,7 @@
154
use core::iter::{FromIterator};
155
use core::mem::swap;
156
use core::ptr;
157
+use core::fmt;
158
159
use slice;
160
use vec::{self, Vec};
@@ -178,6 +179,13 @@ impl<T: Ord> Default for BinaryHeap<T> {
178
179
fn default() -> BinaryHeap<T> { BinaryHeap::new() }
180
}
181
182
+#[stable(feature = "binaryheap_debug", since = "1.4.0")]
183
+impl<T: fmt::Debug + Ord> fmt::Debug for BinaryHeap<T> {
184
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
185
+ f.debug_list().entries(self.iter()).finish()
186
+ }
187
+}
188
+
189
impl<T: Ord> BinaryHeap<T> {
190
/// Creates an empty `BinaryHeap` as a max-heap.
191
///
0 commit comments