review fixups

This commit is contained in:
Nika Layzell 2022-06-17 22:10:07 -04:00
parent af51424008
commit df925fda9c
4 changed files with 43 additions and 70 deletions

View file

@ -498,12 +498,13 @@ impl server::TokenStream for Rustc<'_, '_> {
}
builder.build()
}
fn into_iter(
fn into_trees(
&mut self,
stream: Self::TokenStream,
) -> Vec<TokenTree<Self::Group, Self::Punct, Self::Ident, Self::Literal>> {
// FIXME: This is a raw port of the previous approach, and can probably
// be optimized.
// FIXME: This is a raw port of the previous approach (which had a
// `TokenStreamIter` server-side object with a single `next` method),
// and can probably be optimized (for bulk conversion).
let mut cursor = stream.into_trees();
let mut stack = Vec::new();
let mut tts = Vec::new();