]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/vec_init_then_push.rs
separate the receiver from arguments in HIR under /clippy
[rust.git] / clippy_lints / src / vec_init_then_push.rs
index 35db45e2b0c9921b97672f6322e48a870f658190..542c6a37d567bb09e9bad4433bcaaae15abf79b0 100644 (file)
@@ -100,7 +100,7 @@ fn display_err(&self, cx: &LateContext<'_>) {
                         || get_parent_expr(cx, last_place)
                             .map_or(false, |e| matches!(e.kind, ExprKind::AddrOf(_, Mutability::Mut, _)));
                 },
-                ExprKind::MethodCall(_, [recv, ..], _)
+                ExprKind::MethodCall(_, recv, ..)
                     if recv.hir_id == e.hir_id
                         && adjusted_mut == Mutability::Mut
                         && !adjusted_ty.peel_refs().is_slice() =>
@@ -201,7 +201,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
     fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) {
         if let Some(searcher) = self.searcher.take() {
             if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind
-                && let ExprKind::MethodCall(name, [self_arg, _], _) = expr.kind
+                && let ExprKind::MethodCall(name, self_arg, [_], _) = expr.kind
                 && path_to_local_id(self_arg, searcher.local_id)
                 && name.ident.as_str() == "push"
             {