Skip to content

Commit 599fad8

Browse files
committed
Debug impl for OrderedSet
1 parent 44198dd commit 599fad8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

syntax/set.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::collections::HashSet;
2+
use std::fmt::{self, Debug};
23
use std::hash::Hash;
34
use std::slice;
45

@@ -47,3 +48,12 @@ impl<'s, 'a, T> Iterator for Iter<'s, 'a, T> {
4748
self.0.next().copied()
4849
}
4950
}
51+
52+
impl<'a, T> Debug for OrderedSet<&'a T>
53+
where
54+
T: Debug,
55+
{
56+
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
57+
formatter.debug_set().entries(self).finish()
58+
}
59+
}

0 commit comments

Comments
 (0)