Skip to content

Commit

Permalink
refactor(utils)!: rename delete_dir_contents() to `delete_dir_conte…
Browse files Browse the repository at this point in the history
…nts_following_links()`
  • Loading branch information
rami3l committed Apr 9, 2024
1 parent cb27b9b commit 68db1c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ fn update(cfg: &mut Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
} else {
common::update_all_channels(cfg, self_update, m.get_flag("force"))?;
info!("cleaning up downloads & tmp directories");
utils::delete_dir_contents(&cfg.download_dir);
utils::delete_dir_contents_following_links(&cfg.download_dir);
cfg.temp_cfg.clean();
}

Expand Down
2 changes: 1 addition & 1 deletion src/dist/temp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl Cfg {
}

pub(crate) fn clean(&self) {
utils::delete_dir_contents(&self.root_directory);
utils::delete_dir_contents_following_links(&self.root_directory);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ where
})
}

pub(crate) fn delete_dir_contents(dir_path: &Path) {
pub(crate) fn delete_dir_contents_following_links(dir_path: &Path) {
use remove_dir_all::RemoveDir;

match raw::open_dir_following_links(dir_path).and_then(|mut p| p.remove_dir_contents(None)) {
Expand Down

0 comments on commit 68db1c4

Please sign in to comment.