Skip to content

Commit 0311702

Browse files
committed
manual_retain: Remove redundant match.
1 parent 0f4cd13 commit 0311702

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/manual_retain.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ impl_lint_pass!(ManualRetain => [MANUAL_RETAIN]);
7070
impl<'tcx> LateLintPass<'tcx> for ManualRetain {
7171
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
7272
if let Assign(left_expr, collect_expr, _) = &expr.kind
73-
&& let hir::ExprKind::MethodCall(seg, ..) = &collect_expr.kind
73+
&& let hir::ExprKind::MethodCall(seg, target_expr, [], _) = &collect_expr.kind
7474
&& seg.args.is_none()
75-
&& let hir::ExprKind::MethodCall(_, target_expr, [], _) = &collect_expr.kind
7675
&& let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id)
7776
&& cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id)
7877
{

0 commit comments

Comments
 (0)