about summary refs log tree commit diff
path: root/clippy_dev/src
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2023-03-28 20:52:55 -0400
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2023-03-28 21:08:06 -0400
commit783879e6fe48b5bd776bf2b1c9314fda3e30447d (patch)
tree831db9b3683ddf871bf58cd52bc2a3e6f1f2dcac /clippy_dev/src
parent58fb8014146c22bfdf60f47c864537abc7b78486 (diff)
downloadrust-783879e6fe48b5bd776bf2b1c9314fda3e30447d.tar.gz
rust-783879e6fe48b5bd776bf2b1c9314fda3e30447d.zip
Partial no-op refactoring of #9948
This contains preparatory work for #9948 to keep that change to the
minimum, and make it easier to review it.
Diffstat (limited to 'clippy_dev/src')
-rw-r--r--clippy_dev/src/new_lint.rs8
-rw-r--r--clippy_dev/src/update_lints.rs14
2 files changed, 7 insertions, 15 deletions
diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs
index 420214d9256..13a27703427 100644
--- a/clippy_dev/src/new_lint.rs
+++ b/clippy_dev/src/new_lint.rs
@@ -369,9 +369,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
                     }}
                     todo!();
                 }}
-           "#,
-            context_import = context_import,
-            name_upper = name_upper,
+           "#
         );
     } else {
         let _: fmt::Result = writedoc!(
@@ -385,9 +383,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
                 pub(super) fn check(cx: &{context_import}) {{
                     todo!();
                 }}
-           "#,
-            context_import = context_import,
-            name_upper = name_upper,
+           "#
         );
     }
 
diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs
index 779e4d0e1e3..95222a9acdf 100644
--- a/clippy_dev/src/update_lints.rs
+++ b/clippy_dev/src/update_lints.rs
@@ -537,17 +537,13 @@ fn declare_deprecated(name: &str, path: &Path, reason: &str) -> io::Result<()> {
             /// Nothing. This lint has been deprecated.
             ///
             /// ### Deprecation reason
-            /// {}
-            #[clippy::version = \"{}\"]
-            pub {},
-            \"{}\"
+            /// {deprecation_reason}
+            #[clippy::version = \"{version}\"]
+            pub {name},
+            \"{reason}\"
         }}
 
-        ",
-        deprecation_reason,
-        version,
-        name,
-        reason,
+        "
     )
 }