11use clippy_utils:: diagnostics:: span_lint_and_then;
22use 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} ;
44use core:: ops:: ControlFlow ;
55use rustc_errors:: Applicability ;
66use 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