1
Fork 0
mirror of https://github.com/RGBCube/dix synced 2025-07-27 11:47:46 +00:00

chore: remove rustc-hash dependency, not much overhead

This commit is contained in:
RGBCube 2025-05-09 17:56:50 +03:00 committed by bloxx12
parent d85e9ec3b0
commit 021c972a0f
4 changed files with 10 additions and 24 deletions

7
Cargo.lock generated
View file

@ -190,7 +190,6 @@ dependencies = [
"ref-cast",
"regex",
"rusqlite",
"rustc-hash",
"size",
"unicode-width",
"yansi",
@ -460,12 +459,6 @@ dependencies = [
"smallvec",
]
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "serde"
version = "1.0.219"

View file

@ -16,7 +16,6 @@ log = "0.4.20"
ref-cast = "1.0.24"
regex = "1.11.1"
rusqlite = { version = "0.35.0", features = [ "bundled" ] }
rustc-hash = "2.1.1"
size = "0.5.0"
unicode-width = "0.2.0"
yansi = { version = "1.0.1", features = [ "detect-env", "detect-tty" ] }

View file

@ -1,6 +1,9 @@
use std::fmt::{
self,
Write as _,
use std::{
collections::HashMap,
fmt::{
self,
Write as _,
},
};
use itertools::{
@ -8,10 +11,6 @@ use itertools::{
Itertools,
};
use ref_cast::RefCast as _;
use rustc_hash::{
FxBuildHasher,
FxHashMap,
};
use unicode_width::UnicodeWidthStr as _;
use yansi::Paint as _;
@ -48,8 +47,7 @@ pub fn write_diffln<'a>(
paths_old: impl Iterator<Item = &'a StorePath>,
paths_new: impl Iterator<Item = &'a StorePath>,
) -> Result<usize, fmt::Error> {
let mut paths =
FxHashMap::<&str, Diff<Vec<Option<&Version>>>>::with_hasher(FxBuildHasher);
let mut paths = HashMap::<&str, Diff<Vec<Option<&Version>>>>::new();
for path in paths_old {
match path.parse_name_and_version() {

View file

@ -1,4 +1,5 @@
use std::{
collections::HashMap,
path::Path,
result,
};
@ -8,10 +9,6 @@ use anyhow::{
Result,
};
use derive_more::Deref;
use rustc_hash::{
FxBuildHasher,
FxHashMap,
};
use crate::{
DerivationId,
@ -120,7 +117,7 @@ impl Connection {
pub fn query_dependency_graph(
&mut self,
path: &StorePath,
) -> Result<FxHashMap<DerivationId, Vec<DerivationId>>> {
) -> Result<HashMap<DerivationId, Vec<DerivationId>>> {
const QUERY: &str = "
WITH RECURSIVE
graph(p, c) AS (
@ -137,8 +134,7 @@ impl Connection {
path_to_str!(path);
let mut adj =
FxHashMap::<DerivationId, Vec<DerivationId>>::with_hasher(FxBuildHasher);
let mut adj = HashMap::<DerivationId, Vec<DerivationId>>::new();
let mut statement = self.prepare_cached(QUERY)?;