From abd6b3519c249198353a49d3f782bae1e9675934 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 31 Dec 2024 02:48:07 +0100 Subject: [PATCH] Get rid of rustc_hash --- brood/Cargo.lock | 7 ------- brood/Cargo.toml | 1 - brood/src/commands/ingest.rs | 9 ++++----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/brood/Cargo.lock b/brood/Cargo.lock index 16c8cc8..414bb49 100644 --- a/brood/Cargo.lock +++ b/brood/Cargo.lock @@ -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" diff --git a/brood/Cargo.toml b/brood/Cargo.toml index a560f73..0dd4156 100644 --- a/brood/Cargo.toml +++ b/brood/Cargo.toml @@ -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" diff --git a/brood/src/commands/ingest.rs b/brood/src/commands/ingest.rs index fd26d39..7e0f223 100644 --- a/brood/src/commands/ingest.rs +++ b/brood/src/commands/ingest.rs @@ -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) -> io::Result> { fn compute_title_lookup( normalizer: &TitleNormalizer, titles: &[String], -) -> FxHashMap { +) -> HashMap { let mut counter = Counter::new(); - let mut title_lookup = FxHashMap::::default(); + let mut title_lookup = HashMap::::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, + title_lookup: &HashMap, r: &mut BufReader, ) -> io::Result<(Vec, Vec, Graph)> { let mut counter = Counter::new();