From e34c6dbae5768b5dce90c02465f3492376327c65 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Fri, 12 Jul 2024 00:00:03 -0400 Subject: 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. --- clippy_lints/src/string_patterns.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clippy_lints/src/string_patterns.rs') diff --git a/clippy_lints/src/string_patterns.rs b/clippy_lints/src/string_patterns.rs index 7ba58942a17..7e211d64da1 100644 --- a/clippy_lints/src/string_patterns.rs +++ b/clippy_lints/src/string_patterns.rs @@ -1,6 +1,7 @@ use std::ops::ControlFlow; use clippy_config::msrvs::{self, Msrv}; +use clippy_config::Conf; use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then}; use clippy_utils::eager_or_lazy::switch_to_eager_eval; use clippy_utils::macros::matching_root_macro_call; @@ -75,9 +76,10 @@ pub struct StringPatterns { } impl StringPatterns { - #[must_use] - pub fn new(msrv: Msrv) -> Self { - Self { msrv } + pub fn new(conf: &'static Conf) -> Self { + Self { + msrv: conf.msrv.clone(), + } } } -- cgit 1.4.1-3-g733a5