about summary refs log tree commit diff
path: root/clippy_lints/src/mem_replace.rs
diff options
context:
space:
mode:
authorJason Newcomb <jsnewcomb@pm.me>2024-07-12 00:00:03 -0400
committerJason Newcomb <jsnewcomb@pm.me>2024-07-17 14:05:49 -0400
commite34c6dbae5768b5dce90c02465f3492376327c65 (patch)
tree116eadb846c5d9274bf08e48bfbcda6f47a0fbd9 /clippy_lints/src/mem_replace.rs
parent0ee9f44568b60aaef5d04684cb08f112edd89542 (diff)
Refactor for using config values:
* Construct lint passes by taking `Conf` by reference.
* Use `HashSet` configs in less places
* Move some `check_crate` code into the pass constructor when possible.
Diffstat (limited to 'clippy_lints/src/mem_replace.rs')
-rw-r--r--clippy_lints/src/mem_replace.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs
index 578aa7989e7..72a5945ad9b 100644
--- a/clippy_lints/src/mem_replace.rs
+++ b/clippy_lints/src/mem_replace.rs
@@ -1,4 +1,5 @@
 use clippy_config::msrvs::{self, Msrv};
+use clippy_config::Conf;
 use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_sugg, span_lint_and_then};
 use clippy_utils::source::{snippet, snippet_with_applicability};
 use clippy_utils::sugg::Sugg;
@@ -217,9 +218,10 @@ pub struct MemReplace {
 }
 
 impl MemReplace {
-    #[must_use]
-    pub fn new(msrv: Msrv) -> Self {
-        Self { msrv }
+    pub fn new(conf: &'static Conf) -> Self {
+        Self {
+            msrv: conf.msrv.clone(),
+        }
     }
 }