Skip to content

Commit 25545ed

Browse files
committed
Only print the fields that are relevant to iterators for Debug of IntoKeys and IntoValues
1 parent 29d9233 commit 25545ed

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ impl<K, V> FusedIterator for IntoKeys<K, V> {}
19211921
#[unstable(feature = "map_into_keys_values", issue = "55214")]
19221922
impl<K: Debug, V: Debug> fmt::Debug for IntoKeys<K, V> {
19231923
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1924-
f.debug_list().entries(self.inner.iter()).finish()
1924+
f.debug_list().entries(self.inner.iter().map(|(k, _)| k)).finish()
19251925
}
19261926
}
19271927

@@ -1951,7 +1951,7 @@ impl<K, V> FusedIterator for IntoValues<K, V> {}
19511951
#[unstable(feature = "map_into_keys_values", issue = "55214")]
19521952
impl<K: Debug, V: Debug> fmt::Debug for IntoValues<K, V> {
19531953
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1954-
f.debug_list().entries(self.inner.iter()).finish()
1954+
f.debug_list().entries(self.inner.iter().map(|(_, v)| v)).finish()
19551955
}
19561956
}
19571957

0 commit comments

Comments
 (0)