Skip to content

Commit

Permalink
Merge pull request #342 from dtolnay/debug
Browse files Browse the repository at this point in the history
Improve Debug representation of token_stream::IntoIter
  • Loading branch information
dtolnay authored Jul 25, 2022
2 parents ee0e583 + 9d91c49 commit e338234
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e338234

Please sign in to comment.