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.
This commit is contained in:
Jason Newcomb 2024-07-12 00:00:03 -04:00
parent 0ee9f44568
commit e34c6dbae5
115 changed files with 824 additions and 994 deletions

View file

@ -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(),
}
}
}