Skip to content

Commit 67c1fa0

Browse files
committed
Ensure package IDs are unique when cleaning.
get_many will panic if there are duplicate IDs.
1 parent d829727 commit 67c1fa0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/ops/cargo_clean.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::util::interning::InternedString;
88
use crate::util::{human_readable_bytes, Config, Progress, ProgressStyle};
99
use anyhow::bail;
1010
use cargo_util::paths;
11+
use indexmap::IndexSet;
1112
use std::fs;
1213
use std::path::{Path, PathBuf};
1314

@@ -129,7 +130,7 @@ fn clean_specs(
129130
// Doc tests produce no output.
130131

131132
// Get Packages for the specified specs.
132-
let mut pkg_ids = Vec::new();
133+
let mut pkg_ids = IndexSet::new();
133134
for spec_str in spec.iter() {
134135
// Translate the spec to a Package.
135136
let spec = PackageIdSpec::parse(spec_str)?;

0 commit comments

Comments
 (0)