diff options
| author | Elisha Hollander <just4now666666@gmail.com> | 2023-10-01 16:47:53 +0300 |
|---|---|---|
| committer | donno2048 <just4now666666@gmail.com> | 2024-04-16 22:20:13 +0000 |
| commit | 331fd31e206ab0497bf323b148d93b125179b905 (patch) | |
| tree | 1e7dfbd25c123b530897691eec3db71d6629054a | |
| parent | cfa007f1d157134036d2eee8731e98e361a8f34b (diff) | |
| download | rust-331fd31e206ab0497bf323b148d93b125179b905.tar.gz rust-331fd31e206ab0497bf323b148d93b125179b905.zip | |
use `FxHashMap`
* add `rustc-hash` to cargo manifest * use `FxHashMap`
| -rw-r--r-- | src/tools/tidy/Cargo.toml | 1 | ||||
| -rw-r--r-- | 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<char, char>, + letter_digit: &'a FxHashMap<char, char>, ) -> impl Iterator<Item = u32> + 'a { consts.iter().flat_map(move |const_value| { let problem = |
