Skip to content

Commit

Permalink
use FxHashMap
Browse files Browse the repository at this point in the history
* add `rustc-hash` to cargo manifest

* use `FxHashMap`
  • Loading branch information
donno2048 committed Apr 16, 2024
1 parent cfa007f commit 331fd31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/tools/tidy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 331fd31

Please sign in to comment.