Rollup merge of #23356 - bombless:camelcase, r=alexcrichton
non_camel_case_types lint suggests `ONETWOTHREE` for non-camel type `ONE_TWO_THREE`, which doesn't look good. This patch fixes it.
This commit is contained in:
commit
7eb9c3765f
@ -811,7 +811,7 @@ fn to_camel_case(s: &str) -> String {
|
||||
if i == 0 {
|
||||
c.to_uppercase().collect::<String>()
|
||||
} else {
|
||||
c.to_string()
|
||||
c.to_lowercase().collect()
|
||||
}
|
||||
)).collect::<Vec<_>>().concat()
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user