Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/tt/src/iter.rs')
-rw-r--r--crates/tt/src/iter.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/tt/src/iter.rs b/crates/tt/src/iter.rs
index 3246156f1c..2e89d762a0 100644
--- a/crates/tt/src/iter.rs
+++ b/crates/tt/src/iter.rs
@@ -217,6 +217,17 @@ pub enum TtElement<'a, S> {
Subtree(&'a Subtree<S>, TtIter<'a, S>),
}
+impl<S: Copy + fmt::Debug> fmt::Debug for TtElement<'_, S> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::Leaf(leaf) => f.debug_tuple("Leaf").field(leaf).finish(),
+ Self::Subtree(subtree, inner) => {
+ f.debug_tuple("Subtree").field(subtree).field(inner).finish()
+ }
+ }
+ }
+}
+
impl<S: Copy> TtElement<'_, S> {
#[inline]
pub fn first_span(&self) -> S {