File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -274,18 +274,13 @@ impl NonSnakeCase {
274274 let ident = ident. trim_start_matches ( '\'' ) ;
275275 let ident = ident. trim_matches ( '_' ) ;
276276
277- let mut allow_underscore = true ;
278- ident. chars ( ) . all ( |c| {
279- allow_underscore = match c {
280- '_' if !allow_underscore => return false ,
281- '_' => false ,
282- // It would be more obvious to use `c.is_lowercase()`,
283- // but some characters do not have a lowercase form
284- c if !c. is_uppercase ( ) => true ,
285- _ => return false ,
286- } ;
287- true
288- } )
277+ if ident. contains ( "__" ) {
278+ return false ;
279+ }
280+
281+ // This correctly handles letters in languages with and without
282+ // cases, as well as numbers and underscores.
283+ !ident. chars ( ) . any ( char:: is_uppercase)
289284 }
290285
291286 let name = ident. name . as_str ( ) ;
You can’t perform that action at this time.
0 commit comments