diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-05 13:32:08 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-08 20:27:48 +0100 |
| commit | c37e19843aefbe098bb0d511a877a3831d755704 (patch) | |
| tree | 9950e4a6db7738976917b1eb802e5bf1ad1c5c4f | |
| parent | 0fa461558c85202281b1d33b7b77f27a32459be7 (diff) | |
| download | rust-c37e19843aefbe098bb0d511a877a3831d755704.tar.gz rust-c37e19843aefbe098bb0d511a877a3831d755704.zip | |
don't create owned values for comparison (clippy::cmp_owned)
| -rw-r--r-- | compiler/rustc_lint/src/nonstandard_style.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs index 2720c376774..6d61b86f32e 100644 --- a/compiler/rustc_lint/src/nonstandard_style.rs +++ b/compiler/rustc_lint/src/nonstandard_style.rs @@ -131,7 +131,7 @@ impl NonCamelCaseTypes { let cc = to_camel_case(name); // We cannot provide meaningful suggestions // if the characters are in the category of "Lowercase Letter". - if name.to_string() != cc { + if *name != cc { err.span_suggestion( ident.span, "convert the identifier to upper camel case", @@ -271,7 +271,7 @@ impl NonSnakeCase { let mut err = lint.build(&msg); // We cannot provide meaningful suggestions // if the characters are in the category of "Uppercase Letter". - if name.to_string() != sc { + if *name != sc { // We have a valid span in almost all cases, but we don't have one when linting a crate // name provided via the command line. if !ident.span.is_dummy() { @@ -455,7 +455,7 @@ impl NonUpperCaseGlobals { lint.build(&format!("{} `{}` should have an upper case name", sort, name)); // We cannot provide meaningful suggestions // if the characters are in the category of "Lowercase Letter". - if name.to_string() != uc { + if *name != uc { err.span_suggestion( ident.span, "convert the identifier to upper case", |
