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 Nov 30, 2022
1 parent d28c9b8 commit c329457
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 @@ -295,7 +295,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 c329457

Please sign in to comment.