]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/nonstandard_style.rs
Auto merge of #92664 - ehuss:rollup-t9yrvk5, r=ehuss
[rust.git] / compiler / rustc_lint / src / nonstandard_style.rs
index bcddc4f3d7643b539b23e67f92704537ba034b2e..be7756b0f28f6c97e2df3ff9fbf2992bc3640c74 100644 (file)
@@ -133,7 +133,7 @@ fn to_camel_case(s: &str) -> String {
 
 impl NonCamelCaseTypes {
     fn check_case(&self, cx: &EarlyContext<'_>, sort: &str, ident: &Ident) {
-        let name = &ident.name.as_str();
+        let name = ident.name.as_str();
 
         if !is_camel_case(name) {
             cx.struct_span_lint(NON_CAMEL_CASE_TYPES, ident.span, |lint| {
@@ -276,7 +276,7 @@ fn is_snake_case(ident: &str) -> bool {
             })
         }
 
-        let name = &ident.name.as_str();
+        let name = ident.name.as_str();
 
         if !is_snake_case(name) {
             cx.struct_span_lint(NON_SNAKE_CASE, ident.span, |lint| {
@@ -484,7 +484,7 @@ fn check_struct_def(&mut self, cx: &LateContext<'_>, s: &hir::VariantData<'_>) {
 
 impl NonUpperCaseGlobals {
     fn check_upper_case(cx: &LateContext<'_>, sort: &str, ident: &Ident) {
-        let name = &ident.name.as_str();
+        let name = ident.name.as_str();
         if name.chars().any(|c| c.is_lowercase()) {
             cx.struct_span_lint(NON_UPPER_CASE_GLOBALS, ident.span, |lint| {
                 let uc = NonSnakeCase::to_snake_case(&name).to_uppercase();