Skip to content

Commit

Permalink
Improve camelcase suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
bombless committed Mar 14, 2015
1 parent 79dd393 commit 60aa751
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Expand Up @@ -811,7 +811,7 @@ impl NonCamelCaseTypes {
if i == 0 {
c.to_uppercase().collect::<String>()
} else {
c.to_string()
c.to_lowercase().collect()
}
)).collect::<Vec<_>>().concat()
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/compile-fail/lint-non-camel-case-types.rs
Expand Up @@ -11,6 +11,9 @@
#![forbid(non_camel_case_types)]
#![allow(dead_code)]

struct ONE_TWO_THREE;
//~^ ERROR type `ONE_TWO_THREE` should have a camel case name such as `OneTwoThree`

struct foo { //~ ERROR type `foo` should have a camel case name such as `Foo`
bar: isize,
}
Expand Down

0 comments on commit 60aa751

Please sign in to comment.