Skip to content

Commit c37e198

Browse files
committed
don't create owned values for comparison (clippy::cmp_owned)
1 parent 0fa4615 commit c37e198

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl NonCamelCaseTypes {
131131
let cc = to_camel_case(name);
132132
// We cannot provide meaningful suggestions
133133
// if the characters are in the category of "Lowercase Letter".
134-
if name.to_string() != cc {
134+
if *name != cc {
135135
err.span_suggestion(
136136
ident.span,
137137
"convert the identifier to upper camel case",
@@ -271,7 +271,7 @@ impl NonSnakeCase {
271271
let mut err = lint.build(&msg);
272272
// We cannot provide meaningful suggestions
273273
// if the characters are in the category of "Uppercase Letter".
274-
if name.to_string() != sc {
274+
if *name != sc {
275275
// We have a valid span in almost all cases, but we don't have one when linting a crate
276276
// name provided via the command line.
277277
if !ident.span.is_dummy() {
@@ -455,7 +455,7 @@ impl NonUpperCaseGlobals {
455455
lint.build(&format!("{} `{}` should have an upper case name", sort, name));
456456
// We cannot provide meaningful suggestions
457457
// if the characters are in the category of "Lowercase Letter".
458-
if name.to_string() != uc {
458+
if *name != uc {
459459
err.span_suggestion(
460460
ident.span,
461461
"convert the identifier to upper case",

0 commit comments

Comments
 (0)