]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/utils/author.rs
Change Hash{Map, Set} to FxHash{Map, Set}
[rust.git] / clippy_lints / src / utils / author.rs
index e2c809c0c7cc2e0687a21c43f7ac1c305dfd5ff8..541d5353daf03f86fdc321c01bb0f8c87c831b7c 100644 (file)
@@ -8,8 +8,8 @@
 use rustc::hir;
 use rustc::hir::{Expr, ExprKind, QPath, TyKind, Pat, PatKind, BindingAnnotation, StmtKind, DeclKind, Stmt};
 use rustc::hir::intravisit::{NestedVisitorMap, Visitor};
+use rustc_data_structures::fx::FxHashMap;
 use syntax::ast::{Attribute, LitKind, DUMMY_NODE_ID};
-use std::collections::HashMap;
 use crate::utils::get_attr;
 
 /// **What it does:** Generates clippy code that detects the offending pattern
@@ -154,7 +154,7 @@ fn check_foreign_item(&mut self, _cx: &LateContext<'a, 'tcx>, item: &'tcx hir::F
 impl PrintVisitor {
     fn new(s: &'static str) -> Self {
         Self {
-            ids: HashMap::new(),
+            ids: FxHashMap::default(),
             current: s.to_owned(),
         }
     }
@@ -186,7 +186,7 @@ fn print_qpath(&mut self, path: &QPath) {
 struct PrintVisitor {
     /// Fields are the current index that needs to be appended to pattern
     /// binding names
-    ids: HashMap<&'static str, usize>,
+    ids: FxHashMap<&'static str, usize>,
     /// the name that needs to be destructured
     current: String,
 }