@@ -54,12 +54,12 @@ impl MinIdentChars {
54
54
}
55
55
56
56
#[ expect( clippy:: cast_possible_truncation) ]
57
- fn is_ident_too_short ( & self , cx : & LateContext < ' _ > , str : & str , span : Span ) -> bool {
57
+ fn is_ident_too_short ( & self , cx : & LateContext < ' _ > , s : & str , span : Span ) -> bool {
58
58
!in_external_macro ( cx. sess ( ) , span)
59
- && str . len ( ) <= self . min_ident_chars_threshold as usize
60
- && !str . starts_with ( '_' )
61
- && !str . is_empty ( )
62
- && !self . allowed_idents_below_min_chars . contains ( str )
59
+ && s . len ( ) <= self . min_ident_chars_threshold as usize
60
+ && !s . starts_with ( '_' )
61
+ && !s . is_empty ( )
62
+ && !self . allowed_idents_below_min_chars . contains ( s )
63
63
}
64
64
}
65
65
@@ -83,10 +83,10 @@ impl LateLintPass<'_> for MinIdentChars {
83
83
// This is necessary as `Node::Pat`s are not visited in `visit_id`. :/
84
84
fn check_pat ( & mut self , cx : & LateContext < ' _ > , pat : & Pat < ' _ > ) {
85
85
if let PatKind :: Binding ( _, _, ident, ..) = pat. kind
86
- && let str = ident. as_str ( )
87
- && self . is_ident_too_short ( cx, str , ident. span )
86
+ && let s = ident. as_str ( )
87
+ && self . is_ident_too_short ( cx, s , ident. span )
88
88
{
89
- emit_min_ident_chars ( self , cx, str , ident. span ) ;
89
+ emit_min_ident_chars ( self , cx, s , ident. span ) ;
90
90
}
91
91
}
92
92
}
@@ -117,8 +117,8 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
117
117
return ;
118
118
} ;
119
119
120
- let str = ident. as_str ( ) ;
121
- if conf. is_ident_too_short ( cx, str , ident. span ) {
120
+ let s = ident. as_str ( ) ;
121
+ if conf. is_ident_too_short ( cx, s , ident. span ) {
122
122
// Check whether the node is part of a `use` statement. We don't want to emit a warning if the user
123
123
// has no control over the type.
124
124
let usenode = opt_as_use_node ( node) . or_else ( || {
@@ -134,7 +134,7 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
134
134
// this case, we need to emit the warning for `baz`.
135
135
if let Some ( imported_item_path) = usenode
136
136
&& let Some ( Res :: Def ( _, imported_item_defid) ) = imported_item_path. res . first ( )
137
- && cx. tcx . item_name ( * imported_item_defid) . as_str ( ) == str
137
+ && cx. tcx . item_name ( * imported_item_defid) . as_str ( ) == s
138
138
{
139
139
return ;
140
140
}
@@ -172,7 +172,7 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
172
172
return ;
173
173
}
174
174
175
- emit_min_ident_chars ( conf, cx, str , ident. span ) ;
175
+ emit_min_ident_chars ( conf, cx, s , ident. span ) ;
176
176
}
177
177
}
178
178
}
0 commit comments