@@ -89,18 +89,18 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
89
89
let data = db. function_data ( func) ;
90
90
let body = db. body ( func. into ( ) ) ;
91
91
92
- // 1. Recursively validate inner scope items, such as static variables and constants.
92
+ // Recursively validate inner scope items, such as static variables and constants.
93
93
for ( item_id, _) in body. item_scope . values ( ) {
94
94
let mut validator = DeclValidator :: new ( item_id, self . sink ) ;
95
95
validator. validate_item ( db) ;
96
96
}
97
97
98
- // 2. Check whether non-snake case identifiers are allowed for this function.
98
+ // Check whether non-snake case identifiers are allowed for this function.
99
99
if self . allowed ( db, func. into ( ) , allow:: NON_SNAKE_CASE ) {
100
100
return ;
101
101
}
102
102
103
- // 2. Check the function name.
103
+ // Check the function name.
104
104
let function_name = data. name . to_string ( ) ;
105
105
let fn_name_replacement = if let Some ( new_name) = to_lower_snake_case ( & function_name) {
106
106
let replacement = Replacement {
@@ -113,7 +113,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
113
113
None
114
114
} ;
115
115
116
- // 3. Check the param names.
116
+ // Check the param names.
117
117
let mut fn_param_replacements = Vec :: new ( ) ;
118
118
119
119
for pat_id in body. params . iter ( ) . cloned ( ) {
@@ -135,7 +135,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
135
135
}
136
136
}
137
137
138
- // 4. Check the patterns inside the function body.
138
+ // Check the patterns inside the function body.
139
139
let mut pats_replacements = Vec :: new ( ) ;
140
140
141
141
for ( pat_idx, pat) in body. pats . iter ( ) {
@@ -160,7 +160,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
160
160
}
161
161
}
162
162
163
- // 5. If there is at least one element to spawn a warning on, go to the source map and generate a warning.
163
+ // If there is at least one element to spawn a warning on, go to the source map and generate a warning.
164
164
self . create_incorrect_case_diagnostic_for_func (
165
165
func,
166
166
db,
@@ -187,7 +187,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
187
187
let fn_loc = func. lookup ( db. upcast ( ) ) ;
188
188
let fn_src = fn_loc. source ( db. upcast ( ) ) ;
189
189
190
- // 1. Diagnostic for function name.
190
+ // Diagnostic for function name.
191
191
if let Some ( replacement) = fn_name_replacement {
192
192
let ast_ptr = match fn_src. value . name ( ) {
193
193
Some ( name) => name,
@@ -214,7 +214,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
214
214
self . sink . push ( diagnostic) ;
215
215
}
216
216
217
- // 2. Diagnostics for function params.
217
+ // Diagnostics for function params.
218
218
let fn_params_list = match fn_src. value . param_list ( ) {
219
219
Some ( params) => params,
220
220
None => {
@@ -334,7 +334,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
334
334
self . allowed ( db, struct_id. into ( ) , allow:: NON_CAMEL_CASE_TYPES ) ;
335
335
let non_snake_case_allowed = self . allowed ( db, struct_id. into ( ) , allow:: NON_SNAKE_CASE ) ;
336
336
337
- // 1. Check the structure name.
337
+ // Check the structure name.
338
338
let struct_name = data. name . to_string ( ) ;
339
339
let struct_name_replacement = if let Some ( new_name) = to_camel_case ( & struct_name) {
340
340
let replacement = Replacement {
@@ -351,7 +351,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
351
351
None
352
352
} ;
353
353
354
- // 2. Check the field names.
354
+ // Check the field names.
355
355
let mut struct_fields_replacements = Vec :: new ( ) ;
356
356
357
357
if !non_snake_case_allowed {
@@ -370,7 +370,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
370
370
}
371
371
}
372
372
373
- // 3. If there is at least one element to spawn a warning on, go to the source map and generate a warning.
373
+ // If there is at least one element to spawn a warning on, go to the source map and generate a warning.
374
374
self . create_incorrect_case_diagnostic_for_struct (
375
375
struct_id,
376
376
db,
@@ -470,12 +470,12 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
470
470
fn validate_enum ( & mut self , db : & dyn HirDatabase , enum_id : EnumId ) {
471
471
let data = db. enum_data ( enum_id) ;
472
472
473
- // 1. Check whether non-camel case names are allowed for this enum.
473
+ // Check whether non-camel case names are allowed for this enum.
474
474
if self . allowed ( db, enum_id. into ( ) , allow:: NON_CAMEL_CASE_TYPES ) {
475
475
return ;
476
476
}
477
477
478
- // 2. Check the enum name.
478
+ // Check the enum name.
479
479
let enum_name = data. name . to_string ( ) ;
480
480
let enum_name_replacement = if let Some ( new_name) = to_camel_case ( & enum_name) {
481
481
let replacement = Replacement {
@@ -488,7 +488,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
488
488
None
489
489
} ;
490
490
491
- // 3. Check the field names.
491
+ // Check the field names.
492
492
let mut enum_fields_replacements = Vec :: new ( ) ;
493
493
494
494
for ( _, variant) in data. variants . iter ( ) {
@@ -503,7 +503,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
503
503
}
504
504
}
505
505
506
- // 4. If there is at least one element to spawn a warning on, go to the source map and generate a warning.
506
+ // If there is at least one element to spawn a warning on, go to the source map and generate a warning.
507
507
self . create_incorrect_case_diagnostic_for_enum (
508
508
enum_id,
509
509
db,
0 commit comments