]> git.lizzy.rs Git - rust.git/commitdiff
change config variables to reference, remove wildcard import
authorFrank <lifrank@grinnell.edu>
Thu, 24 Sep 2020 21:26:29 +0000 (16:26 -0500)
committerFrank <lifrank@grinnell.edu>
Fri, 25 Sep 2020 16:09:04 +0000 (11:09 -0500)
clippy_lints/src/disallowed_method.rs
clippy_lints/src/lib.rs

index 42fbff8ff879dd3b005bb8078258ee47bd6e3bdb..7638019340f0e19ef701c98cdb002cde29d7d92d 100644 (file)
@@ -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()
index 7c886ab87d0e68f0d69a533ae3fecc7ed67bfc64..7b6efc660af653be3591f5811f8fcd34231527c1 100644 (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 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![