use FxHashMap

* add `rustc-hash` to cargo manifest

* use `FxHashMap`
This commit is contained in:
Elisha Hollander 2023-10-01 16:47:53 +03:00 committed by donno2048
parent cfa007f1d1
commit 331fd31e20
2 changed files with 4 additions and 2 deletions

View File

@ -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"

View File

@ -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<char, char>,
letter_digit: &'a FxHashMap<char, char>,
) -> impl Iterator<Item = u32> + 'a {
consts.iter().flat_map(move |const_value| {
let problem =