Skip to content

Commit 1014efa

Browse files
committed
handle MethodCall
1 parent 90563d0 commit 1014efa

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clippy_lints/src/suspicious_chained_operators.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::iter::FusedIterator;
1+
use core::iter::{self, FusedIterator};
22
use if_chain::if_chain;
33
use crate::utils::{span_lint_and_sugg, snippet_with_applicability};
44
use rustc_data_structures::fx::FxHashSet;
@@ -363,6 +363,17 @@ impl <'expr> Iterator for IdentIter<'expr> {
363363
)
364364
)
365365
},
366+
ExprKind::MethodCall(ref method_name, ref args, _) => {
367+
let current_expr: &'expr Expr = self.expr;
368+
369+
set_and_call_next!(
370+
iter::once((method_name.ident, current_expr))
371+
.chain(
372+
args.iter()
373+
.flat_map(IdentIter::new_p)
374+
)
375+
)
376+
},
366377
_ => todo!(),
367378
};
368379

0 commit comments

Comments
 (0)