Skip to content

Instantly share code, notes, and snippets.

@frewsxcv
Created January 18, 2017 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frewsxcv/5a17ccdbf11ae576ba5c195826fcd0e5 to your computer and use it in GitHub Desktop.
Save frewsxcv/5a17ccdbf11ae576ba5c195826fcd0e5 to your computer and use it in GitHub Desktop.
diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs
index 8c61b06f2b..b194798677 100644
--- a/src/libcollections/btree/map.rs
+++ b/src/libcollections/btree/map.rs
@@ -422,12 +422,16 @@ impl<'a, K: 'a, V: 'a> fmt::Debug for RangeMut<'a, K, V> {
}
}
-/*#[stable(feature = "collection_debug", since = "1.15.0")]
+#[stable(feature = "collection_debug", since = "1.15.0")]
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for RangeMut<'a, K, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.debug_list().entries(self.clone()).finish()
+ let range = Range {
+ front: self.front.reborrow(),
+ back: self.back.reborrow(),
+ };
+ f.debug_list().entries(range).finish()
}
-}*/
+}
/// A view into a single entry in a map, which may either be vacant or occupied.
/// This enum is constructed from the [`entry`] method on [`BTreeMap`].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment