Skip to content

Commit 0b68cd7

Browse files
committed
Ensure package IDs are unique when cleaning.
get_many will panic if there are duplicate IDs.
1 parent 976771d commit 0b68cd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/ops/cargo_clean.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::util::{Config, Progress, ProgressStyle};
99

1010
use anyhow::{bail, Context as _};
1111
use cargo_util::paths;
12+
use indexmap::IndexSet;
1213
use std::fs;
1314
use std::path::Path;
1415

@@ -104,7 +105,7 @@ pub fn clean(ws: &Workspace<'_>, opts: &CleanOptions<'_>) -> CargoResult<()> {
104105
// Doc tests produce no output.
105106

106107
// Get Packages for the specified specs.
107-
let mut pkg_ids = Vec::new();
108+
let mut pkg_ids = IndexSet::new();
108109
for spec_str in opts.spec.iter() {
109110
// Translate the spec to a Package.
110111
let spec = PackageIdSpec::parse(spec_str)?;

0 commit comments

Comments
 (0)