Switch to `rustc_hash` instead of `ahash`

This commit is contained in:
Michael Partheil 2023-10-03 20:22:25 +02:00 committed by Dirkjan Ochtman
parent 3b3627422b
commit 647adb1694
3 changed files with 4 additions and 4 deletions

View File

@ -13,10 +13,10 @@ readme = "../README.md"
[features] [features]
__test_data = ["test-cases"] __test_data = ["test-cases"]
test-cases = [] test-cases = []
with-serde = ["serde", "ahash/serde", "smartstring/serde"] with-serde = ["serde", "smartstring/serde"]
[dependencies] [dependencies]
ahash = "0.8" rustc-hash = "1.1.0"
smartstring = "1" smartstring = "1"
serde = { version = "1.0.123", features = ["derive"], optional = true } serde = { version = "1.0.123", features = ["derive"], optional = true }

View File

@ -4,12 +4,12 @@
//! data files from publicly available sources. See the README in `/data`. //! data files from publicly available sources. See the README in `/data`.
use std::cmp::Reverse; use std::cmp::Reverse;
use std::collections::{HashMap, HashSet};
use std::fs::File; use std::fs::File;
use std::io::Write; use std::io::Write;
use std::io::{BufRead, BufReader, BufWriter}; use std::io::{BufRead, BufReader, BufWriter};
use std::str::FromStr; use std::str::FromStr;
use ahash::{AHashMap as HashMap, AHashSet as HashSet};
use rayon::iter::{IntoParallelIterator, ParallelIterator}; use rayon::iter::{IntoParallelIterator, ParallelIterator};
use smartstring::alias::String as SmartString; use smartstring::alias::String as SmartString;

View File

@ -256,7 +256,7 @@ impl std::fmt::Display for InvalidCharacter {
} }
} }
type HashMap<K, V> = std::collections::HashMap<K, V, ahash::RandomState>; type HashMap<K, V> = rustc_hash::FxHashMap<K, V>;
const DEFAULT_LIMIT: usize = 24; const DEFAULT_LIMIT: usize = 24;