1
Fork 0

don't create owned values for comparison (clippy::cmp_owned)

This commit is contained in:
Matthias Krüger 2020-12-05 13:32:08 +01:00
parent 0fa461558c
commit c37e19843a

View file

@ -131,7 +131,7 @@ impl NonCamelCaseTypes {
let cc = to_camel_case(name); let cc = to_camel_case(name);
// We cannot provide meaningful suggestions // We cannot provide meaningful suggestions
// if the characters are in the category of "Lowercase Letter". // if the characters are in the category of "Lowercase Letter".
if name.to_string() != cc { if *name != cc {
err.span_suggestion( err.span_suggestion(
ident.span, ident.span,
"convert the identifier to upper camel case", "convert the identifier to upper camel case",
@ -271,7 +271,7 @@ impl NonSnakeCase {
let mut err = lint.build(&msg); let mut err = lint.build(&msg);
// We cannot provide meaningful suggestions // We cannot provide meaningful suggestions
// if the characters are in the category of "Uppercase Letter". // 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 // 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. // name provided via the command line.
if !ident.span.is_dummy() { if !ident.span.is_dummy() {
@ -455,7 +455,7 @@ impl NonUpperCaseGlobals {
lint.build(&format!("{} `{}` should have an upper case name", sort, name)); lint.build(&format!("{} `{}` should have an upper case name", sort, name));
// We cannot provide meaningful suggestions // We cannot provide meaningful suggestions
// if the characters are in the category of "Lowercase Letter". // if the characters are in the category of "Lowercase Letter".
if name.to_string() != uc { if *name != uc {
err.span_suggestion( err.span_suggestion(
ident.span, ident.span,
"convert the identifier to upper case", "convert the identifier to upper case",