Skip to content

Commit

Permalink
lint: make the non_camel_case_types lint work with scripts without a …
Browse files Browse the repository at this point in the history
…upper/lowercase distinction.
  • Loading branch information
huonw committed Jul 1, 2013
1 parent 07feeb9 commit da43845
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,10 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
let ident = cx.sess.str_of(ident);
assert!(!ident.is_empty());
let ident = ident.trim_chars(&'_');
char::is_uppercase(ident.char_at(0)) &&

// start with a non-lowercase letter rather than non-uppercase
// ones (some scripts don't have a concept of upper/lowercase)
!ident.char_at(0).is_lowercase() &&
!ident.contains_char('_')
}

Expand Down

0 comments on commit da43845

Please sign in to comment.