@@ -16,7 +16,7 @@ use crate::syntax::ast::*;
1616use crate :: syntax:: source_map:: Span ;
1717use crate :: syntax:: symbol:: LocalInternedString ;
1818use crate :: utils:: { span_help_and_lint, span_lint} ;
19- use crate :: utils:: { camel_case_from , camel_case_until , in_macro} ;
19+ use crate :: utils:: { camel_case , in_macro} ;
2020
2121/// **What it does:** Detects enumeration variants that are prefixed or suffixed
2222/// by the same characters.
@@ -184,19 +184,19 @@ fn check_variant(
184184 }
185185 }
186186 let first = var2str ( & def. variants [ 0 ] ) ;
187- let mut pre = & first[ ..camel_case_until ( & * first) ] ;
188- let mut post = & first[ camel_case_from ( & * first) ..] ;
187+ let mut pre = & first[ ..camel_case :: until ( & * first) ] ;
188+ let mut post = & first[ camel_case :: from ( & * first) ..] ;
189189 for var in & def. variants {
190190 let name = var2str ( var) ;
191191
192192 let pre_match = partial_match ( pre, & name) ;
193193 pre = & pre[ ..pre_match] ;
194- let pre_camel = camel_case_until ( pre) ;
194+ let pre_camel = camel_case :: until ( pre) ;
195195 pre = & pre[ ..pre_camel] ;
196196 while let Some ( ( next, last) ) = name[ pre. len ( ) ..] . chars ( ) . zip ( pre. chars ( ) . rev ( ) ) . next ( ) {
197197 if next. is_lowercase ( ) {
198198 let last = pre. len ( ) - last. len_utf8 ( ) ;
199- let last_camel = camel_case_until ( & pre[ ..last] ) ;
199+ let last_camel = camel_case :: until ( & pre[ ..last] ) ;
200200 pre = & pre[ ..last_camel] ;
201201 } else {
202202 break ;
@@ -206,7 +206,7 @@ fn check_variant(
206206 let post_match = partial_rmatch ( post, & name) ;
207207 let post_end = post. len ( ) - post_match;
208208 post = & post[ post_end..] ;
209- let post_camel = camel_case_from ( post) ;
209+ let post_camel = camel_case :: from ( post) ;
210210 post = & post[ post_camel..] ;
211211 }
212212 let ( what, value) = match ( pre. is_empty ( ) , post. is_empty ( ) ) {
@@ -255,6 +255,7 @@ impl EarlyLintPass for EnumVariantNames {
255255 assert ! ( last. is_some( ) ) ;
256256 }
257257
258+ #[ allow( clippy:: similar_names) ]
258259 fn check_item ( & mut self , cx : & EarlyContext < ' _ > , item : & Item ) {
259260 let item_name = item. ident . as_str ( ) ;
260261 let item_name_chars = item_name. chars ( ) . count ( ) ;
0 commit comments