Skip to content

Conversation

@Boshen
Copy link
Collaborator

@Boshen Boshen commented Jul 1, 2025

The only call site that iterates through the indexmap doesn't seem to require the map to be in the order of declaration.

pnp-rs/src/lib.rs

Lines 160 to 175 in b443744

for (name, ranges) in manifest.package_registry_data.iter_mut() {
for (reference, info) in ranges.iter_mut() {
let package_location = manifest.manifest_dir.join(info.package_location.clone());
let normalized_location = util::normalize_path(package_location.to_string_lossy());
info.package_location = PathBuf::from(normalized_location);
if !info.discard_from_lookup {
manifest.location_trie.insert(
&info.package_location,
PackageLocator { name: name.clone(), reference: reference.clone() },
);
}
}
}

@Boshen Boshen requested a review from arcanis July 1, 2025 06:33
@arcanis
Copy link
Member

arcanis commented Jul 1, 2025

I think I added that when adding a clippy warning against unstable traversal, as I got quite a few mistakes due to this in other programs. That said in this particular app it's probably ok.

@arcanis arcanis merged commit 8db3fc7 into main Jul 1, 2025
5 checks passed
@arcanis arcanis deleted the remove-index-map branch July 1, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants