about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYork Xiang <bombless@126.com>2015-03-14 13:40:33 +0800
committerYork Xiang <bombless@126.com>2015-03-14 13:40:33 +0800
commit60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa (patch)
tree032c3ca974c8a1d9a2a35c3c9bfb87244fa666db
parent79dd393a4f144fa5e6f81c720c782de3175810d7 (diff)
downloadrust-60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa.tar.gz
rust-60aa7516209f50eff7fd879fc2b0e6c5d5ebb8aa.zip
Improve camelcase suggestion
-rw-r--r--src/librustc_lint/builtin.rs2
-rw-r--r--src/test/compile-fail/lint-non-camel-case-types.rs3
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,
 }