Skip to content

Commit

Permalink
Ensure package IDs are unique when cleaning.
Browse files Browse the repository at this point in the history
get_many will panic if there are duplicate IDs.
  • Loading branch information
jfgoog committed Sep 20, 2023
1 parent 976771d commit 0b68cd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cargo/ops/cargo_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::util::{Config, Progress, ProgressStyle};

use anyhow::{bail, Context as _};
use cargo_util::paths;
use indexmap::IndexSet;
use std::fs;
use std::path::Path;

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

// Get Packages for the specified specs.
let mut pkg_ids = Vec::new();
let mut pkg_ids = IndexSet::new();
for spec_str in opts.spec.iter() {
// Translate the spec to a Package.
let spec = PackageIdSpec::parse(spec_str)?;
Expand Down

0 comments on commit 0b68cd7

Please sign in to comment.