about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNazım Can Altınova <canaltinova@gmail.com>2020-08-10 17:47:40 +0200
committerNazım Can Altınova <canaltinova@gmail.com>2020-08-10 23:06:04 +0200
commit456738e3d1ad7dadffaed287d3055ca38b5fa375 (patch)
tree139b811b8a6d2085175cff605a5136a6b8745823
parenta313abe3ba989ba4b6c041627c903488886f8559 (diff)
downloadrust-456738e3d1ad7dadffaed287d3055ca38b5fa375.tar.gz
rust-456738e3d1ad7dadffaed287d3055ca38b5fa375.zip
Only print values in the Debug of HashMap::ValuesMut struct
-rw-r--r--library/std/src/collections/hash/map.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs
index 70f7214e2f1..968f81c2c35 100644
--- a/library/std/src/collections/hash/map.rs
+++ b/library/std/src/collections/hash/map.rs
@@ -1885,13 +1885,9 @@ impl<K, V> ExactSizeIterator for ValuesMut<'_, K, V> {
 impl<K, V> FusedIterator for ValuesMut<'_, K, V> {}
 
 #[stable(feature = "std_debug", since = "1.16.0")]
-impl<K, V> fmt::Debug for ValuesMut<'_, K, V>
-where
-    K: fmt::Debug,
-    V: fmt::Debug,
-{
+impl<K, V: fmt::Debug> fmt::Debug for ValuesMut<'_, K, V> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_list().entries(self.inner.iter()).finish()
+        f.debug_list().entries(self.inner.iter().map(|(_, val)| val)).finish()
     }
 }