Get rid of rustc_hash

This commit is contained in:
Joscha 2024-12-31 02:48:07 +01:00
parent e04215802e
commit abd6b3519c
3 changed files with 4 additions and 13 deletions

7
brood/Cargo.lock generated
View file

@ -66,7 +66,6 @@ version = "0.0.0"
dependencies = [
"clap",
"regex",
"rustc-hash",
"serde",
"serde_json",
"thousands",
@ -189,12 +188,6 @@ version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "rustc-hash"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497"
[[package]]
name = "ryu"
version = "1.0.18"

View file

@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
clap = { version = "4.5.23", features = ["derive", "deprecated"] }
regex = "1.11.1"
rustc-hash = "2.1.0"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
thousands = "0.2.0"

View file

@ -1,11 +1,10 @@
use std::{
collections::hash_map::Entry,
collections::{hash_map::Entry, HashMap},
fs::File,
io::{self, BufRead, BufReader, Seek},
path::{Path, PathBuf},
};
use rustc_hash::FxHashMap;
use serde::Deserialize;
use thousands::Separable;
@ -49,9 +48,9 @@ fn read_titles(r: &mut BufReader<File>) -> io::Result<Vec<String>> {
fn compute_title_lookup(
normalizer: &TitleNormalizer,
titles: &[String],
) -> FxHashMap<String, (u32, u32)> {
) -> HashMap<String, (u32, u32)> {
let mut counter = Counter::new();
let mut title_lookup = FxHashMap::<String, (u32, u32)>::default();
let mut title_lookup = HashMap::<String, (u32, u32)>::new();
for (sift_i, title) in titles.iter().enumerate() {
counter.tick();
@ -86,7 +85,7 @@ fn compute_title_lookup(
fn read_page_data(
normalizer: &TitleNormalizer,
title_lookup: &FxHashMap<String, (u32, u32)>,
title_lookup: &HashMap<String, (u32, u32)>,
r: &mut BufReader<File>,
) -> io::Result<(Vec<Page>, Vec<Link>, Graph)> {
let mut counter = Counter::new();