Skip to content

Commit 0b09d35

Browse files
committed
Fix dogfood errors (FxHashSet and pass-by-value)
1 parent 2bd90a4 commit 0b09d35

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/collect.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc::hir::{Expr, Stmt, DeclKind, StmtKind, ExprKind};
1313
use rustc::ty::{AssociatedKind};
1414
use syntax::ast::NodeId;
1515

16-
use std::collections::HashSet;
16+
use crate::rustc_data_structures::fx::FxHashSet;
1717

1818
use crate::rustc_errors::Applicability;
1919
use crate::rustc::lint::{
@@ -62,12 +62,12 @@ declare_clippy_lint! {
6262
#[derive(Clone, Default)]
6363
pub struct Pass {
6464
// To ensure that we do not lint the same expression more than once
65-
seen_expr_nodes: HashSet<NodeId>,
65+
seen_expr_nodes: FxHashSet<NodeId>,
6666
}
6767

6868
impl Pass {
6969
pub fn new() -> Self {
70-
Self { seen_expr_nodes: HashSet::new() }
70+
Self { seen_expr_nodes: FxHashSet::default() }
7171
}
7272
}
7373

@@ -85,7 +85,7 @@ struct Suggestion {
8585

8686
fn format_suggestion_pattern<'a, 'tcx>(
8787
cx: &LateContext<'a, 'tcx>,
88-
collection_ty: &ty::Ty<'_>,
88+
collection_ty: ty::Ty<'_>,
8989
is_option: bool,
9090
) -> String {
9191
let collection_pat = match collection_ty.sty {

0 commit comments

Comments
 (0)