From 4366423bfeeca6182ae2421940c20bf554064f06 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 30 Sep 2021 02:07:20 -0400 Subject: [PATCH] Resolve needless_borrow clippy lint error: this expression borrows a reference (`&syn::parse::ParseBuffer`) that is immediately dereferenced by the compiler --> tests/test_parse_buffer.rs:15:35 | 15 | input1.advance_to(&input2); | ^^^^^^^ help: change this to: `input2` | = note: `-D clippy::needless-borrow` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow --- tests/test_parse_buffer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_parse_buffer.rs b/tests/test_parse_buffer.rs index ab8583c6f6..cc23e9ba6c 100644 --- a/tests/test_parse_buffer.rs +++ b/tests/test_parse_buffer.rs @@ -1,4 +1,4 @@ -#![allow(clippy::needless_borrow, clippy::non_ascii_literal)] +#![allow(clippy::non_ascii_literal)] use proc_macro2::{Delimiter, Group, Punct, Spacing, TokenStream, TokenTree}; use std::iter::FromIterator; @@ -12,7 +12,7 @@ fn smuggled_speculative_cursor_between_sources() { impl Parse for BreakRules { fn parse(input1: ParseStream) -> Result { let nested = |input2: ParseStream| { - input1.advance_to(&input2); + input1.advance_to(input2); Ok(Self) }; nested.parse_str("")