Do not consider method call receiver as an argument in AST.

This commit is contained in:
Camille GILLOT 2022-08-07 15:21:11 +02:00
parent 1603a70f82
commit 9701845287
19 changed files with 107 additions and 55 deletions

View file

@ -608,8 +608,7 @@ trait UnusedDelimLint {
ref call_or_other => {
let (args_to_check, ctx) = match *call_or_other {
Call(_, ref args) => (&args[..], UnusedDelimsCtx::FunctionArg),
// first "argument" is self (which sometimes needs delims)
MethodCall(_, ref args, _) => (&args[1..], UnusedDelimsCtx::MethodArg),
MethodCall(_, _, ref args, _) => (&args[..], UnusedDelimsCtx::MethodArg),
// actual catch-all arm
_ => {
return;