@@ -316,31 +316,19 @@ impl<'a> DeclValidator<'a> {
316316 /// Check incorrect names for patterns inside the function body.
317317 /// This includes function parameters except for trait implementation associated functions.
318318 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-
323319 let body = self . db . body ( func. into ( ) ) ;
324320 let mut pats_replacements = body
325321 . pats
326322 . iter ( )
327323 . filter_map ( |( pat_id, pat) | match pat {
328324 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) )
344332 }
345333 _ => None ,
346334 } )
0 commit comments