Rollup merge of #79505 - matklad:cleanup, r=jonas-schievink

Cleanup: shorter and faster code
This commit is contained in:
Dylan DPC 2020-11-29 03:14:24 +01:00 committed by GitHub
commit 6eb5245555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();