@@ -30,7 +30,7 @@ pub(super) fn check<'tcx>(
30
30
if let Body { params: [ p] , value: body_expr, generator_kind: _ } = cx. tcx. hir( ) . body( c. body) ;
31
31
if let PatKind :: Tuple ( [ key_pat, val_pat] , _) = p. pat. kind;
32
32
33
- let ( replacement_kind, annotation, binded_ident ) = match ( & key_pat. kind, & val_pat. kind) {
33
+ let ( replacement_kind, annotation, bound_ident ) = match ( & key_pat. kind, & val_pat. kind) {
34
34
( key, PatKind :: Binding ( ann, _, value, _) ) if pat_is_wild( cx, key, m_arg) => ( "value" , ann, value) ,
35
35
( PatKind :: Binding ( ann, _, key, _) , value) if pat_is_wild( cx, value, m_arg) => ( "key" , ann, key) ,
36
36
_ => return ,
@@ -47,7 +47,7 @@ pub(super) fn check<'tcx>(
47
47
if_chain! {
48
48
if let ExprKind :: Path ( rustc_hir:: QPath :: Resolved ( _, path) ) = body_expr. kind;
49
49
if let [ local_ident] = path. segments;
50
- if local_ident. ident. as_str( ) == binded_ident . as_str( ) ;
50
+ if local_ident. ident. as_str( ) == bound_ident . as_str( ) ;
51
51
52
52
then {
53
53
span_lint_and_sugg(
@@ -76,7 +76,7 @@ pub(super) fn check<'tcx>(
76
76
expr. span,
77
77
& format!( "iterating on a map's {replacement_kind}s" ) ,
78
78
"try" ,
79
- format!( "{recv_snippet}.{into_prefix}{replacement_kind}s().map(|{ref_annotation}{mut_annotation}{binded_ident }| {})" ,
79
+ format!( "{recv_snippet}.{into_prefix}{replacement_kind}s().map(|{ref_annotation}{mut_annotation}{bound_ident }| {})" ,
80
80
snippet_with_applicability( cx, body_expr. span, "/* body */" , & mut applicability) ) ,
81
81
applicability,
82
82
) ;
0 commit comments