about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-11-28 17:47:34 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-11-28 17:47:34 +0300
commit30d331ffb664a321ff091c50d2b816804c6257db (patch)
treeb6802200ae3721c12d46513d7e3f1cbfdebd78af
parent4ae328bef47dffcbf363e5ae873f419c06a5511d (diff)
downloadrust-30d331ffb664a321ff091c50d2b816804c6257db.tar.gz
rust-30d331ffb664a321ff091c50d2b816804c6257db.zip
Cleanup: shorter and faster code
-rw-r--r--compiler/rustc_lint/src/nonstandard_style.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs
index dd2627f7bc1..2720c376774 100644
--- a/compiler/rustc_lint/src/nonstandard_style.rs
+++ b/compiler/rustc_lint/src/nonstandard_style.rs
@@ -94,9 +94,9 @@ fn to_camel_case(s: &str) -> String {
                 }
 
                 if new_word {
-                    camel_cased_component.push_str(&c.to_uppercase().to_string());
+                    camel_cased_component.extend(c.to_uppercase());
                 } else {
-                    camel_cased_component.push_str(&c.to_lowercase().to_string());
+                    camel_cased_component.extend(c.to_lowercase());
                 }
 
                 prev_is_lower_case = c.is_lowercase();