@@ -316,31 +316,19 @@ impl<'a> DeclValidator<'a> {
316
316
/// Check incorrect names for patterns inside the function body.
317
317
/// This includes function parameters except for trait implementation associated functions.
318
318
fn validate_func_body ( & mut self , func : FunctionId ) {
319
- // Check whether function is an associated item of a trait implementation
320
- let container = func. lookup ( self . db . upcast ( ) ) . container ;
321
- let is_trait_impl_assoc_fn = self . is_trait_impl_container ( container) ;
322
-
323
319
let body = self . db . body ( func. into ( ) ) ;
324
320
let mut pats_replacements = body
325
321
. pats
326
322
. iter ( )
327
323
. filter_map ( |( pat_id, pat) | match pat {
328
324
Pat :: Bind { id, .. } => {
329
- // Filter out parameters for trait implementation associated functions.
330
- if is_trait_impl_assoc_fn
331
- && body. params . iter ( ) . any ( |param_id| * param_id == pat_id)
332
- {
333
- cov_mark:: hit!( trait_impl_assoc_func_param_incorrect_case_ignored) ;
334
- None
335
- } else {
336
- let bind_name = & body. bindings [ * id] . name ;
337
- let replacement = Replacement {
338
- current_name : bind_name. clone ( ) ,
339
- suggested_text : to_lower_snake_case ( & bind_name. to_smol_str ( ) ) ?,
340
- expected_case : CaseType :: LowerSnakeCase ,
341
- } ;
342
- Some ( ( pat_id, replacement) )
343
- }
325
+ let bind_name = & body. bindings [ * id] . name ;
326
+ let replacement = Replacement {
327
+ current_name : bind_name. clone ( ) ,
328
+ suggested_text : to_lower_snake_case ( & bind_name. to_smol_str ( ) ) ?,
329
+ expected_case : CaseType :: LowerSnakeCase ,
330
+ } ;
331
+ Some ( ( pat_id, replacement) )
344
332
}
345
333
_ => None ,
346
334
} )
0 commit comments