Expose size_hint() for TokenStream's iterator

This commit is contained in:
David Tolnay 2022-07-24 20:36:22 -07:00
parent babff2211e
commit 63e74aba81
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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")]