diff options
| author | York Xiang <bombless@126.com> | 2015-03-14 13:40:33 +0800 |
|---|---|---|
| committer | York Xiang <bombless@126.com> | 2015-03-14 13:40:33 +0800 |
| commit | 60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa (patch) | |
| tree | 032c3ca974c8a1d9a2a35c3c9bfb87244fa666db | |
| parent | 79dd393a4f144fa5e6f81c720c782de3175810d7 (diff) | |
| download | rust-60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa.tar.gz rust-60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa.zip | |
Improve camelcase suggestion
| -rw-r--r-- | src/librustc_lint/builtin.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/lint-non-camel-case-types.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 074591fb927..f6f82c65374 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -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() } diff --git a/src/test/compile-fail/lint-non-camel-case-types.rs b/src/test/compile-fail/lint-non-camel-case-types.rs index 9f58d5791cb..f6d3d62d0bf 100644 --- a/src/test/compile-fail/lint-non-camel-case-types.rs +++ b/src/test/compile-fail/lint-non-camel-case-types.rs @@ -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, } |
