Simplify RefTokenTreeCursor::look_ahead.

It's only ever used with a lookahead of 0, so this commit removes the
lookahead and renames it `peek`.
This commit is contained in:
Nicholas Nethercote 2024-12-11 12:29:04 +11:00
parent 6dfa37f02a
commit 5c200c2255

View file

@ -86,7 +86,7 @@ fn contains_unhygienic_crate_reference(tts: &TokenStream) -> Option<Span> {
while let Some(curr) = cursor.next() {
if !prev_is_dollar
&& let Some(span) = is_crate_keyword(curr)
&& let Some(next) = cursor.look_ahead(0)
&& let Some(next) = cursor.peek()
&& is_token(next, &TokenKind::PathSep)
{
return Some(span);