]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/inherent_to_string.rs
Rollup merge of #83092 - petrochenkov:qspan, r=estebank
[rust.git] / clippy_lints / src / inherent_to_string.rs
index 76e7a4992d345c4c57738d2a9636adb3ec582472..c1f3e1d9d685c13809e93f128303c914722cfba7 100644 (file)
@@ -106,6 +106,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<
             let decl = &signature.decl;
             if decl.implicit_self.has_implicit_self();
             if decl.inputs.len() == 1;
+            if impl_item.generics.params.is_empty();
 
             // Check if return type is String
             if is_type_diagnostic_item(cx, return_ty(cx, impl_item.hir_id()), sym::string_type);
@@ -138,7 +139,7 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
                 self_type.to_string()
             ),
             None,
-            &format!("remove the inherent method from type `{}`", self_type.to_string())
+            &format!("remove the inherent method from type `{}`", self_type.to_string()),
         );
     } else {
         span_lint_and_help(