Skip to content

Commit

Permalink
cargo clean: use remove_dir_all
Browse files Browse the repository at this point in the history
  • Loading branch information
trevyn committed May 28, 2023
1 parent 6956c04 commit b07456e
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 @@ -297,7 +297,8 @@ fn rm_rf(path: &Path, config: &Config, progress: &mut dyn CleaningProgressBar) -
let entry = entry?;
progress.on_clean()?;
if entry.file_type().is_dir() {
paths::remove_dir(entry.path()).with_context(|| "could not remove build directory")?;
paths::remove_dir_all(entry.path())
.with_context(|| "could not remove build directory")?;
} else {
paths::remove_file(entry.path()).with_context(|| "failed to remove build artifact")?;
}
Expand Down

0 comments on commit b07456e

Please sign in to comment.