From ab9b7a5ad23bd2cb2097719ad9439277b8f5d987 Mon Sep 17 00:00:00 2001 From: y21 <30553356+y21@users.noreply.github.com> Date: Tue, 18 Apr 2023 00:25:39 +0200 Subject: [PATCH] remove unnecessary reference --- clippy_lints/src/loops/while_pop_unwrap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/loops/while_pop_unwrap.rs b/clippy_lints/src/loops/while_pop_unwrap.rs index 1e31184b34d..fc6797d72c0 100644 --- a/clippy_lints/src/loops/while_pop_unwrap.rs +++ b/clippy_lints/src/loops/while_pop_unwrap.rs @@ -34,7 +34,7 @@ fn report_lint(cx: &LateContext<'_>, pop_span: Span, pop_stmt_kind: PopStmt<'_>, pop_span, "you seem to be trying to pop elements from a `Vec` in a loop", |diag| { - let (pat, pop_replacement) = match &pop_stmt_kind { + let (pat, pop_replacement) = match pop_stmt_kind { PopStmt::Local(pat) => (snippet(cx, pat.span, ".."), String::new()), PopStmt::Anonymous => (Cow::Borrowed("element"), "element".into()), }; @@ -78,7 +78,7 @@ fn check_local(cx: &LateContext<'_>, stmt: &Stmt<'_>, is_empty_recv: &Expr<'_>, && let Some(init) = local.init && is_vec_pop_unwrap(cx, init, is_empty_recv) { - report_lint(cx, stmt.span, PopStmt::Local(&local.pat), loop_span, is_empty_recv.span); + report_lint(cx, stmt.span, PopStmt::Local(local.pat), loop_span, is_empty_recv.span); } }