@@ -78,7 +78,7 @@ struct ExistingName {
78
78
interned : SymbolStr ,
79
79
span : Span ,
80
80
len : usize ,
81
- whitelist : & ' static [ & ' static str ] ,
81
+ exemptions : & ' static [ & ' static str ] ,
82
82
}
83
83
84
84
struct SimilarNamesLocalVisitor < ' a , ' tcx > {
@@ -117,7 +117,7 @@ impl<'a, 'tcx> SimilarNamesLocalVisitor<'a, 'tcx> {
117
117
// this list contains lists of names that are allowed to be similar
118
118
// the assumption is that no name is ever contained in multiple lists.
119
119
#[ rustfmt:: skip]
120
- const WHITELIST : & [ & [ & str ] ] = & [
120
+ const ALLOWED_TO_BE_SIMILAR : & [ & [ & str ] ] = & [
121
121
& [ "parsed" , "parser" ] ,
122
122
& [ "lhs" , "rhs" ] ,
123
123
& [ "tx" , "rx" ] ,
@@ -156,17 +156,17 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
156
156
}
157
157
158
158
#[ must_use]
159
- fn get_whitelist ( interned_name : & str ) -> Option < & ' static [ & ' static str ] > {
160
- for & allow in WHITELIST {
161
- if whitelisted ( interned_name, allow ) {
162
- return Some ( allow ) ;
159
+ fn get_exemptions ( interned_name : & str ) -> Option < & ' static [ & ' static str ] > {
160
+ for & list in ALLOWED_TO_BE_SIMILAR {
161
+ if allowed_to_be_similar ( interned_name, list ) {
162
+ return Some ( list ) ;
163
163
}
164
164
}
165
165
None
166
166
}
167
167
168
168
#[ must_use]
169
- fn whitelisted ( interned_name : & str , list : & [ & str ] ) -> bool {
169
+ fn allowed_to_be_similar ( interned_name : & str , list : & [ & str ] ) -> bool {
170
170
list. iter ( )
171
171
. any ( |& name| interned_name. starts_with ( name) || interned_name. ends_with ( name) )
172
172
}
@@ -212,7 +212,7 @@ impl<'a, 'tcx, 'b> SimilarNamesNameVisitor<'a, 'tcx, 'b> {
212
212
return ;
213
213
}
214
214
for existing_name in & self . 0 . names {
215
- if whitelisted ( & interned_name, existing_name. whitelist ) {
215
+ if allowed_to_be_similar ( & interned_name, existing_name. exemptions ) {
216
216
continue ;
217
217
}
218
218
let mut split_at = None ;
@@ -301,7 +301,7 @@ impl<'a, 'tcx, 'b> SimilarNamesNameVisitor<'a, 'tcx, 'b> {
301
301
return ;
302
302
}
303
303
self . 0 . names . push ( ExistingName {
304
- whitelist : get_whitelist ( & interned_name) . unwrap_or ( & [ ] ) ,
304
+ exemptions : get_exemptions ( & interned_name) . unwrap_or ( & [ ] ) ,
305
305
interned : interned_name,
306
306
span : ident. span ,
307
307
len : count,
0 commit comments