diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-11 12:29:04 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-18 10:31:39 +1100 |
| commit | 5c200c225514ef98abaef295af027333b2f6765e (patch) | |
| tree | 3dbef34242f79562c2054210c204479a6511b3fd | |
| parent | 6dfa37f02a86b4474fbae70e724f7fd6c9f32985 (diff) | |
| download | rust-5c200c225514ef98abaef295af027333b2f6765e.tar.gz rust-5c200c225514ef98abaef295af027333b2f6765e.zip | |
Simplify `RefTokenTreeCursor::look_ahead`.
It's only ever used with a lookahead of 0, so this commit removes the lookahead and renames it `peek`.
| -rw-r--r-- | clippy_lints/src/crate_in_macro_def.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/crate_in_macro_def.rs b/clippy_lints/src/crate_in_macro_def.rs index c8f81413728..76b88b746cb 100644 --- a/clippy_lints/src/crate_in_macro_def.rs +++ b/clippy_lints/src/crate_in_macro_def.rs @@ -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); |
