change config variables to reference, remove wildcard import

This commit is contained in:
Frank
2020-09-24 16:26:29 -05:00
parent 9eb52d2eb6
commit 725a0ef8b1
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
use crate::utils::span_lint; use crate::utils::span_lint;
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;
use rustc_hir::*; use rustc_hir::{Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass}; use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::Symbol; use rustc_span::Symbol;
@@ -36,7 +36,7 @@ pub struct DisallowedMethod {
} }
impl DisallowedMethod { impl DisallowedMethod {
pub fn new(disallowed: FxHashSet<String>) -> Self { pub fn new(disallowed: &FxHashSet<String>) -> Self {
Self { Self {
disallowed: disallowed disallowed: disallowed
.iter() .iter()

View File

@@ -1121,7 +1121,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
store.register_late_pass(|| box manual_strip::ManualStrip); store.register_late_pass(|| box manual_strip::ManualStrip);
store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem); store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem);
let disallowed_methods = conf.disallowed_methods.iter().cloned().collect::<FxHashSet<_>>(); let disallowed_methods = conf.disallowed_methods.iter().cloned().collect::<FxHashSet<_>>();
store.register_late_pass(move || box disallowed_method::DisallowedMethod::new(disallowed_methods.clone())); store.register_late_pass(move || box disallowed_method::DisallowedMethod::new(&disallowed_methods));
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![