@@ -9,7 +9,7 @@ use rustc_middle::ty;
9
9
10
10
/// Checks for the `UNUSED_ENUMERATE_INDEX` lint.
11
11
pub ( super ) fn check < ' tcx > ( cx : & LateContext < ' tcx > , pat : & ' tcx Pat < ' _ > , arg : & ' tcx Expr < ' _ > , body : & ' tcx Expr < ' _ > ) {
12
- let PatKind :: Tuple ( tuple , _) = pat. kind else {
12
+ let PatKind :: Tuple ( [ index , elem ] , _) = pat. kind else {
13
13
return ;
14
14
} ;
15
15
@@ -19,7 +19,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, arg: &'tcx
19
19
20
20
let ty = cx. typeck_results ( ) . expr_ty ( arg) ;
21
21
22
- if !pat_is_wild ( cx, & tuple [ 0 ] . kind , body) {
22
+ if !pat_is_wild ( cx, & index . kind , body) {
23
23
return ;
24
24
}
25
25
@@ -53,7 +53,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>, arg: &'tcx
53
53
diag,
54
54
"remove the `.enumerate()` call" ,
55
55
vec ! [
56
- ( pat. span, snippet( cx, tuple [ 1 ] . span, ".." ) . into_owned( ) ) ,
56
+ ( pat. span, snippet( cx, elem . span, ".." ) . into_owned( ) ) ,
57
57
( arg. span, base_iter. to_string( ) ) ,
58
58
] ,
59
59
) ;
0 commit comments