Skip to content

Commit

Permalink
change config variables to reference, remove wildcard import
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank committed Sep 24, 2020
1 parent 60e00ee commit df81b6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/disallowed_method.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![
Expand Down

0 comments on commit df81b6f

Please sign in to comment.