Skip to content

Commit 63e74ab

Browse files
committed
Expose size_hint() for TokenStream's iterator
1 parent babff22 commit 63e74ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/proc_macro/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,14 @@ pub mod token_stream {
382382
bridge::TokenTree::Literal(tt) => TokenTree::Literal(Literal(tt)),
383383
})
384384
}
385+
386+
fn size_hint(&self) -> (usize, Option<usize>) {
387+
self.0.size_hint()
388+
}
389+
390+
fn count(self) -> usize {
391+
self.0.count()
392+
}
385393
}
386394

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

0 commit comments

Comments
 (0)