Skip to content

Commit e594967

Browse files
committed
impl Debug for ParValuesMut
1 parent 19789dc commit e594967

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
@@ -948,6 +948,8 @@ impl<K, V> ExactSizeIterator for ValuesMut<'_, K, V> {
948948

949949
impl<K, V> FusedIterator for ValuesMut<'_, K, V> {}
950950

951+
// TODO: `impl Debug for ValuesMut` once we have MSRV 1.53 for `slice::IterMut::as_slice`
952+
951953
/// An owning iterator over the values of a `IndexMap`.
952954
///
953955
/// This `struct` is created by the [`into_values`] method on [`IndexMap`].

src/rayon/map.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ pub struct ParValuesMut<'a, K, V> {
346346
entries: &'a mut [Bucket<K, V>],
347347
}
348348

349+
impl<K, V: fmt::Debug> fmt::Debug for ParValuesMut<'_, K, V> {
350+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
351+
let iter = self.entries.iter().map(Bucket::value_ref);
352+
f.debug_list().entries(iter).finish()
353+
}
354+
}
355+
349356
impl<'a, K: Send, V: Send> ParallelIterator for ParValuesMut<'a, K, V> {
350357
type Item = &'a mut V;
351358

0 commit comments

Comments
 (0)