Skip to content

Commit

Permalink
Expose size_hint() for TokenStream's iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 25, 2022
1 parent babff22 commit 63e74ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,14 @@ pub mod token_stream {
bridge::TokenTree::Literal(tt) => TokenTree::Literal(Literal(tt)),
})
}

fn size_hint(&self) -> (usize, Option<usize>) {
self.0.size_hint()
}

fn count(self) -> usize {
self.0.count()
}
}

#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
Expand Down

0 comments on commit 63e74ab

Please sign in to comment.