Skip to content

Commit 19789dc

Browse files
committed
impl Debug for ParIterMut
1 parent 2b9cbea commit 19789dc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/map.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,8 @@ impl<K, V> ExactSizeIterator for IterMut<'_, K, V> {
10571057

10581058
impl<K, V> FusedIterator for IterMut<'_, K, V> {}
10591059

1060+
// TODO: `impl Debug for IterMut` once we have MSRV 1.53 for `slice::IterMut::as_slice`
1061+
10601062
/// An owning iterator over the entries of a `IndexMap`.
10611063
///
10621064
/// This `struct` is created by the [`into_iter`] method on [`IndexMap`]

src/rayon/map.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ pub struct ParIterMut<'a, K, V> {
139139
entries: &'a mut [Bucket<K, V>],
140140
}
141141

142+
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for ParIterMut<'_, K, V> {
143+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
144+
let iter = self.entries.iter().map(Bucket::refs);
145+
f.debug_list().entries(iter).finish()
146+
}
147+
}
148+
142149
impl<'a, K: Sync + Send, V: Send> ParallelIterator for ParIterMut<'a, K, V> {
143150
type Item = (&'a K, &'a mut V);
144151

0 commit comments

Comments
 (0)