1
Fork 0

refactor: add chunks method to TokenStream to obviate rustdoc clones

This commit is contained in:
Caleb Cartwright 2023-05-12 16:57:29 -05:00
parent 2c41369acc
commit 00c3f7552e
2 changed files with 5 additions and 2 deletions

View file

@ -551,6 +551,10 @@ impl TokenStream {
vec_mut.extend(stream_iter);
}
}
pub fn chunks(&self, chunk_size: usize) -> core::slice::Chunks<'_, TokenTree> {
self.0.chunks(chunk_size)
}
}
/// By-reference iterator over a [`TokenStream`], that produces `&TokenTree`