diff options
| author | Frank <lifrank@grinnell.edu> | 2020-09-24 16:26:29 -0500 |
|---|---|---|
| committer | Frank <lifrank@grinnell.edu> | 2020-09-25 11:09:04 -0500 |
| commit | 725a0ef8b1948e459d266cd0ab33dda0c8bc3708 (patch) | |
| tree | aca2525fa187343c2dfd37af944087da3d2b249f | |
| parent | 9eb52d2eb6c3812367276bc19c23f5d7368de664 (diff) | |
| download | rust-725a0ef8b1948e459d266cd0ab33dda0c8bc3708.tar.gz rust-725a0ef8b1948e459d266cd0ab33dda0c8bc3708.zip | |
change config variables to reference, remove wildcard import
| -rw-r--r-- | clippy_lints/src/disallowed_method.rs | 4 | ||||
| -rw-r--r-- | clippy_lints/src/lib.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/disallowed_method.rs b/clippy_lints/src/disallowed_method.rs index 42fbff8ff87..7638019340f 100644 --- a/clippy_lints/src/disallowed_method.rs +++ b/clippy_lints/src/disallowed_method.rs @@ -1,7 +1,7 @@ use crate::utils::span_lint; use rustc_data_structures::fx::FxHashSet; -use rustc_hir::*; +use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::Symbol; @@ -36,7 +36,7 @@ pub struct DisallowedMethod { } impl DisallowedMethod { - pub fn new(disallowed: FxHashSet<String>) -> Self { + pub fn new(disallowed: &FxHashSet<String>) -> Self { Self { disallowed: disallowed .iter() diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 7c886ab87d0..7b6efc660af 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -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 utils::internal_lints::MatchTypeOnDiagItem); 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