| commit | 599fad85bf78d3b3421a4d8f833e618932afd1ca | [log] [tgz] |
|---|---|---|
| author | David Tolnay <dtolnay@gmail.com> | Sat Oct 03 19:42:16 2020 -0700 |
| committer | David Tolnay <dtolnay@gmail.com> | Sat Oct 03 21:21:32 2020 -0700 |
| tree | a1316a9cebccc26e6adb35d6114d800569d80dd7 | |
| parent | 44198dd15a306922f61da07e08f5aa6492e40a0e [diff] [blame] |
Debug impl for OrderedSet
diff --git a/syntax/set.rs b/syntax/set.rs index de13088..b553169 100644 --- a/syntax/set.rs +++ b/syntax/set.rs
@@ -1,4 +1,5 @@ use std::collections::HashSet; +use std::fmt::{self, Debug}; use std::hash::Hash; use std::slice; @@ -47,3 +48,12 @@ self.0.next().copied() } } + +impl<'a, T> Debug for OrderedSet<&'a T> +where + T: Debug, +{ + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.debug_set().entries(self).finish() + } +}