diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2024-07-12 00:00:03 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2024-07-17 14:05:49 -0400 |
| commit | e34c6dbae5768b5dce90c02465f3492376327c65 (patch) | |
| tree | 116eadb846c5d9274bf08e48bfbcda6f47a0fbd9 /clippy_lints/src/tuple_array_conversions.rs | |
| parent | 0ee9f44568b60aaef5d04684cb08f112edd89542 (diff) | |
| download | rust-e34c6dbae5768b5dce90c02465f3492376327c65.tar.gz rust-e34c6dbae5768b5dce90c02465f3492376327c65.zip | |
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/tuple_array_conversions.rs')
| -rw-r--r-- | clippy_lints/src/tuple_array_conversions.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/clippy_lints/src/tuple_array_conversions.rs b/clippy_lints/src/tuple_array_conversions.rs index 564b065d0ba..1d0de932754 100644 --- a/clippy_lints/src/tuple_array_conversions.rs +++ b/clippy_lints/src/tuple_array_conversions.rs @@ -1,4 +1,5 @@ use clippy_config::msrvs::{self, Msrv}; +use clippy_config::Conf; use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::visitors::for_each_local_use_after_expr; use clippy_utils::{is_from_proc_macro, path_to_local}; @@ -42,9 +43,15 @@ declare_clippy_lint! { } impl_lint_pass!(TupleArrayConversions => [TUPLE_ARRAY_CONVERSIONS]); -#[derive(Clone)] pub struct TupleArrayConversions { - pub msrv: Msrv, + msrv: Msrv, +} +impl TupleArrayConversions { + pub fn new(conf: &'static Conf) -> Self { + Self { + msrv: conf.msrv.clone(), + } + } } impl LateLintPass<'_> for TupleArrayConversions { |
