[ui] Rearrange StringReader/TokenTreesReader creation.

`TokenTreesReader` wraps a `StringReader`, but the `into_token_trees`
function obscures this. This commit moves to a more straightforward
control flow.
This commit is contained in:
Nicholas Nethercote 2022-09-26 08:50:52 +10:00
parent 33ba2776c9
commit 33516ac09a
2 changed files with 20 additions and 20 deletions

View file

@ -48,7 +48,8 @@ pub(crate) fn parse_token_trees<'a>(
start_pos = start_pos + BytePos::from_usize(shebang_len);
}
StringReader { sess, start_pos, pos: start_pos, src, override_span }.into_token_trees()
let string_reader = StringReader { sess, start_pos, pos: start_pos, src, override_span };
tokentrees::TokenTreesReader::parse_token_trees(string_reader)
}
struct StringReader<'a> {