We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d10ee0d commit fa9a99fCopy full SHA for fa9a99f
compiler/rustc_lint/src/nonstandard_style.rs
@@ -56,8 +56,19 @@ declare_lint! {
56
57
declare_lint_pass!(NonCamelCaseTypes => [NON_CAMEL_CASE_TYPES]);
58
59
+/// Some unicode characters *have* case, are considered upper case or lower case, but they *can't*
60
+/// be upper cased or lower cased. For the purposes of the lint suggestion, we care about being able
61
+/// to change the char's case.
62
fn char_has_case(c: char) -> bool {
- c.to_lowercase().to_string() != c.to_uppercase().to_string()
63
+ let mut l = c.to_lowercase();
64
+ let mut u = c.to_uppercase();
65
+ while let Some(l) = l.next() {
66
+ match u.next() {
67
+ Some(u) if l != u => return true,
68
+ _ => {}
69
+ }
70
71
+ u.next().is_some()
72
}
73
74
fn is_camel_case(name: &str) -> bool {
0 commit comments