diff options
author | Igor Aleksanov <[email protected]> | 2020-10-08 06:33:35 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-10-12 09:05:00 +0100 |
commit | 559cc970732d80e3ec624c20da4f8aac219d6b2e (patch) | |
tree | cc0efeae2653890f8c178c4b970851d7fc9552af /crates/hir_ty/src/diagnostics/decl_check | |
parent | ebd30033b3743fafe0a0182b5ae34ffb27fe43ff (diff) |
Add to_upper_snake_case function to stdx
Diffstat (limited to 'crates/hir_ty/src/diagnostics/decl_check')
-rw-r--r-- | crates/hir_ty/src/diagnostics/decl_check/case_conv.rs (renamed from crates/hir_ty/src/diagnostics/decl_check/str_helpers.rs) | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/hir_ty/src/diagnostics/decl_check/str_helpers.rs b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs index 2e1468c4c..3800f2a6b 100644 --- a/crates/hir_ty/src/diagnostics/decl_check/str_helpers.rs +++ b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs | |||
@@ -136,8 +136,7 @@ pub fn to_upper_snake_case(ident: &str) -> Option<String> { | |||
136 | } | 136 | } |
137 | 137 | ||
138 | // Normalize the string from whatever form it's in currently, and then just make it uppercase. | 138 | // Normalize the string from whatever form it's in currently, and then just make it uppercase. |
139 | let upper_snake_case = | 139 | let upper_snake_case = stdx::to_upper_snake_case(ident); |
140 | stdx::to_lower_snake_case(ident).chars().map(|c| c.to_ascii_uppercase()).collect(); | ||
141 | 140 | ||
142 | if upper_snake_case == ident { | 141 | if upper_snake_case == ident { |
143 | // While we didn't detect the correct case at the beginning, there | 142 | // While we didn't detect the correct case at the beginning, there |