Skip to content

Commit

Permalink
Only print values in the Debug of HashMap::ValuesMut struct
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Aug 10, 2020
1 parent a313abe commit 456738e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 456738e

Please sign in to comment.