Skip to content

Commit

Permalink
Use inspect_err over map_err
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Sep 19, 2024
1 parent 23e125e commit 2f7c754
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,8 @@ pub fn fetch(
// the folder into the permanent location
if with_build_info || !installation_has_build_info(temp_dir.path()) {
let temp_dir = temp_dir.into_path();
fs::rename(&temp_dir, &target_dir).map_err(|err| {
fs::rename(&temp_dir, &target_dir).inspect_err(|_| {
fs::remove_dir_all(&temp_dir).ok();
err
})

// otherwise move the contents of the `install` folder over.
Expand Down

0 comments on commit 2f7c754

Please sign in to comment.