Skip to content

Commit 456738e

Browse files
committed
Only print values in the Debug of HashMap::ValuesMut struct
1 parent a313abe commit 456738e

File tree

1 file changed

+2
-6
lines changed
  • library/std/src/collections/hash

1 file changed

+2
-6
lines changed

library/std/src/collections/hash/map.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,13 +1885,9 @@ impl<K, V> ExactSizeIterator for ValuesMut<'_, K, V> {
18851885
impl<K, V> FusedIterator for ValuesMut<'_, K, V> {}
18861886

18871887
#[stable(feature = "std_debug", since = "1.16.0")]
1888-
impl<K, V> fmt::Debug for ValuesMut<'_, K, V>
1889-
where
1890-
K: fmt::Debug,
1891-
V: fmt::Debug,
1892-
{
1888+
impl<K, V: fmt::Debug> fmt::Debug for ValuesMut<'_, K, V> {
18931889
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1894-
f.debug_list().entries(self.inner.iter()).finish()
1890+
f.debug_list().entries(self.inner.iter().map(|(_, val)| val)).finish()
18951891
}
18961892
}
18971893

0 commit comments

Comments
 (0)