Skip to content

Commit 36e6a98

Browse files
committed
Remove unused variable
1 parent bdf6eec commit 36e6a98

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clippy_lints/src/unit_types/let_unit_value.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::source::snippet_with_context;
3-
use clippy_utils::visitors::{for_each_local_assignment, for_each_value_source, is_local_used};
3+
use clippy_utils::visitors::{for_each_local_assignment, for_each_value_source};
44
use core::ops::ControlFlow;
55
use rustc_errors::Applicability;
66
use rustc_hir::def::{DefKind, Res};
@@ -82,7 +82,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, local: &'tcx LetStmt<'_>) {
8282

8383
// If this is a binding pattern, we need to add suggestions to remove any usages
8484
// of the variable
85-
if let PatKind::Binding(_, binding_hir_id, ident, ..) = local.pat.kind
85+
if let PatKind::Binding(_, binding_hir_id, _, ..) = local.pat.kind
8686
&& let Some(body_id) = cx.enclosing_body.as_ref()
8787
{
8888
let body = cx.tcx.hir().body(*body_id);
@@ -92,7 +92,6 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, local: &'tcx LetStmt<'_>) {
9292
walk_body(&mut visitor, body);
9393

9494
// Add suggestions for replacing variable usages
95-
let has_usages = !visitor.spans.is_empty();
9695
suggestions.extend(visitor.spans.into_iter().map(|span| (span, "()".to_string())));
9796
}
9897

0 commit comments

Comments
 (0)