]> git.lizzy.rs Git - rust.git/commitdiff
Correctly iterate on keys/values when debugging BTreeMap::{Keys,Values}.
authorFederico Ravasio <ravasio.federico@gmail.com>
Fri, 23 Jun 2017 10:47:43 +0000 (12:47 +0200)
committerFederico Ravasio <ravasio.federico@gmail.com>
Fri, 23 Jun 2017 10:47:43 +0000 (12:47 +0200)
src/liballoc/btree/map.rs

index d73c0254a74574221e1cd44d9ff12fe858cf588d..6656c90d7e9c7ac4a07e632d0854c54a87623a13 100644 (file)
@@ -336,7 +336,7 @@ pub struct Keys<'a, K: 'a, V: 'a> {
 #[stable(feature = "collection_debug", since = "1.17.0")]
 impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Keys<'a, K, V> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_list().entries(self.inner.clone()).finish()
+        f.debug_list().entries(self.clone()).finish()
     }
 }
 
@@ -355,7 +355,7 @@ pub struct Values<'a, K: 'a, V: 'a> {
 #[stable(feature = "collection_debug", since = "1.17.0")]
 impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_list().entries(self.inner.clone()).finish()
+        f.debug_list().entries(self.clone()).finish()
     }
 }