Skip to content

Commit 8db3fc7

Browse files
authored
Merge pull request #33 from yarnpkg/remove-index-map
refactor: remove indexmap
2 parents b443744 + 6cfac17 commit 8db3fc7

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ byteorder = "1"
1212
clean-path = "0.2.1"
1313
concurrent_lru = "^0.2"
1414
fancy-regex = { version = "^0.14.0", default-features = false, features = ["std"] }
15-
indexmap = { version = "2", default-features = true, features = ["serde"] }
1615
miniz_oxide = "^0.8"
1716
mmap-rs = { version = "^0.6", optional = true }
1817
path-slash = "0.2.1"

src/manifest.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use std::{hash::BuildHasherDefault, path::PathBuf};
1+
use std::path::PathBuf;
22

3-
use indexmap::IndexMap;
4-
use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
3+
use rustc_hash::{FxHashMap, FxHashSet};
54
use serde::{Deserialize, de::Deserializer};
65

76
use crate::util::{RegexDef, Trie};
@@ -49,8 +48,7 @@ pub struct Manifest {
4948
// }]
5049
// ]
5150
#[serde(deserialize_with = "deserialize_package_registry_data")]
52-
pub package_registry_data:
53-
FxHashMap<String, IndexMap<String, PackageInformation, BuildHasherDefault<FxHasher>>>,
51+
pub package_registry_data: FxHashMap<String, FxHashMap<String, PackageInformation>>,
5452
}
5553

5654
#[derive(Clone, Debug, Default, Eq, PartialEq, Hash, Deserialize)]
@@ -110,13 +108,9 @@ where
110108
Ok(map)
111109
}
112110

113-
#[expect(clippy::type_complexity)]
114111
fn deserialize_package_registry_data<'de, D>(
115112
deserializer: D,
116-
) -> Result<
117-
FxHashMap<String, IndexMap<String, PackageInformation, BuildHasherDefault<FxHasher>>>,
118-
D::Error,
119-
>
113+
) -> Result<FxHashMap<String, FxHashMap<String, PackageInformation>>, D::Error>
120114
where
121115
D: Deserializer<'de>,
122116
{
@@ -126,7 +120,7 @@ where
126120
let mut map = FxHashMap::default();
127121
for item in Vec::<Item>::deserialize(deserializer)? {
128122
let key = item.0.unwrap_or_else(|| "".to_string());
129-
let value = IndexMap::from_iter(
123+
let value = FxHashMap::from_iter(
130124
item.1.into_iter().map(|(k, v)| (k.unwrap_or_else(|| "".to_string()), v)),
131125
);
132126
map.insert(key, value);

0 commit comments

Comments
 (0)