diff --git a/src/lib.rs b/src/lib.rs index f11e122c..5a1c4e1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1298,7 +1298,8 @@ pub mod token_stream { impl Debug for IntoIter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - Debug::fmt(&self.inner, f) + f.write_str("TokenStream ")?; + f.debug_list().entries(self.clone()).finish() } } diff --git a/src/wrapper.rs b/src/wrapper.rs index 750e156f..15d6dc4c 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -350,12 +350,6 @@ impl Iterator for TokenTreeIter { } } -impl Debug for TokenTreeIter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("TokenTreeIter").finish() - } -} - #[derive(Clone, PartialEq, Eq)] #[cfg(super_unstable)] pub(crate) enum SourceFile {