File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 11use clippy_utils:: diagnostics:: span_lint;
2- use rustc_ast:: ast:: { Expr , ExprKind } ;
2+ use rustc_ast:: ast:: { Expr , ExprKind , MethodCall } ;
33use rustc_lint:: { EarlyContext , EarlyLintPass } ;
44use rustc_session:: declare_lint_pass;
55
@@ -42,18 +42,12 @@ impl EarlyLintPass for DoubleParens {
4242 fn check_expr ( & mut self , cx : & EarlyContext < ' _ > , expr : & Expr ) {
4343 let span = match & expr. kind {
4444 ExprKind :: Paren ( in_paren) if matches ! ( in_paren. kind, ExprKind :: Paren ( _) | ExprKind :: Tup ( _) ) => expr. span ,
45- ExprKind :: Call ( _, args)
45+ ExprKind :: Call ( _, args) | ExprKind :: MethodCall ( box MethodCall { args , .. } )
4646 if let [ args] = & * * args
4747 && let ExprKind :: Paren ( _) = args. kind =>
4848 {
4949 args. span
5050 } ,
51- ExprKind :: MethodCall ( call)
52- if let [ arg] = & * call. args
53- && let ExprKind :: Paren ( _) = arg. kind =>
54- {
55- arg. span
56- } ,
5751 _ => return ,
5852 } ;
5953 if !expr. span . from_expansion ( ) {
You can’t perform that action at this time.
0 commit comments