From 331fd31e206ab0497bf323b148d93b125179b905 Mon Sep 17 00:00:00 2001 From: Elisha Hollander Date: Sun, 1 Oct 2023 16:47:53 +0300 Subject: [PATCH] use `FxHashMap` * add `rustc-hash` to cargo manifest * use `FxHashMap` --- src/tools/tidy/Cargo.toml | 1 + src/tools/tidy/src/style.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml index 58302b8e63b..a76915faac6 100644 --- a/src/tools/tidy/Cargo.toml +++ b/src/tools/tidy/Cargo.toml @@ -13,6 +13,7 @@ walkdir = "2" ignore = "0.4.18" semver = "1.0" termcolor = "1.1.3" +rustc-hash = "1.1.0" [[bin]] name = "rust-tidy" diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index e58e768a31a..7a35ff91beb 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -19,7 +19,8 @@ use crate::walk::{filter_dirs, walk}; use regex::{Regex, RegexSet}; -use std::{collections::HashMap, ffi::OsStr, path::Path}; +use rustc_hash::FxHashMap; +use std::{ffi::OsStr, path::Path}; /// Error code markdown is restricted to 80 columns because they can be /// displayed on the console with --example. @@ -67,7 +68,7 @@ const ANNOTATIONS_TO_IGNORE: &[&str] = &[ fn generate_problems<'a>( consts: &'a [u32], - letter_digit: &'a HashMap, + letter_digit: &'a FxHashMap, ) -> impl Iterator + 'a { consts.iter().flat_map(move |const_value| { let problem =