1- use solar_ast:: { ItemFunction , VariableDefinition } ;
2-
31use super :: { MixedCaseFunction , MixedCaseVariable } ;
42use crate :: {
53 declare_forge_lint,
64 linter:: { EarlyLintPass , LintContext } ,
75 sol:: { Severity , SolLint } ,
86} ;
7+ use solar_ast:: { ItemFunction , VariableDefinition } ;
98
109declare_forge_lint ! (
1110 MIXED_CASE_FUNCTION ,
@@ -18,9 +17,8 @@ declare_forge_lint!(
1817impl < ' ast > EarlyLintPass < ' ast > for MixedCaseFunction {
1918 fn check_item_function ( & mut self , ctx : & LintContext < ' _ > , func : & ' ast ItemFunction < ' ast > ) {
2019 if let Some ( name) = func. header . name {
21- let name = name. as_str ( ) ;
22- if !is_mixed_case ( name, true ) {
23- ctx. emit ( & MIXED_CASE_FUNCTION , func. body_span ) ;
20+ if !is_mixed_case ( name. as_str ( ) , true ) {
21+ ctx. emit ( & MIXED_CASE_FUNCTION , name. span ) ;
2422 }
2523 }
2624 }
@@ -41,9 +39,8 @@ impl<'ast> EarlyLintPass<'ast> for MixedCaseVariable {
4139 ) {
4240 if var. mutability . is_none ( ) {
4341 if let Some ( name) = var. name {
44- let name = name. as_str ( ) ;
45- if !is_mixed_case ( name, false ) {
46- ctx. emit ( & MIXED_CASE_VARIABLE , var. span ) ;
42+ if !is_mixed_case ( name. as_str ( ) , false ) {
43+ ctx. emit ( & MIXED_CASE_VARIABLE , name. span ) ;
4744 }
4845 }
4946 }
0 commit comments