diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2024-06-13 02:46:58 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2024-07-07 18:10:46 -0400 |
| commit | 03117026aedde8e26d14b856caae84e76a799831 (patch) | |
| tree | e671d7cf3c0a8584902173f3f5f1b18405bd03a8 | |
| parent | 0f4cd13f666fff504ea07c7e1ab3858942878dd5 (diff) | |
| download | rust-03117026aedde8e26d14b856caae84e76a799831.tar.gz rust-03117026aedde8e26d14b856caae84e76a799831.zip | |
`manual_retain`: Remove redundant match.
| -rw-r--r-- | clippy_lints/src/manual_retain.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clippy_lints/src/manual_retain.rs b/clippy_lints/src/manual_retain.rs index 3ddb06a1e08..8f7b8abd0c3 100644 --- a/clippy_lints/src/manual_retain.rs +++ b/clippy_lints/src/manual_retain.rs @@ -70,9 +70,8 @@ impl_lint_pass!(ManualRetain => [MANUAL_RETAIN]); impl<'tcx> LateLintPass<'tcx> for ManualRetain { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { if let Assign(left_expr, collect_expr, _) = &expr.kind - && let hir::ExprKind::MethodCall(seg, ..) = &collect_expr.kind + && let hir::ExprKind::MethodCall(seg, target_expr, [], _) = &collect_expr.kind && seg.args.is_none() - && let hir::ExprKind::MethodCall(_, target_expr, [], _) = &collect_expr.kind && let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id) && cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id) { |
