From 2f7c7549970c4c44b15992b0468ffa309ab5c218 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 19 Sep 2024 14:55:08 -0400 Subject: [PATCH] Use inspect_err over map_err --- rye/src/bootstrap.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rye/src/bootstrap.rs b/rye/src/bootstrap.rs index f84fcf5b4e..cb3a8d4634 100644 --- a/rye/src/bootstrap.rs +++ b/rye/src/bootstrap.rs @@ -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.