From 0c7be7285c8a4109f44d4353fa60b63c517b7a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 6 Jul 2024 00:23:09 +0100 Subject: [PATCH] build: remove symlink on Windows before creating it (#1516) --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index af1d02e2..212aa5f5 100644 --- a/build.rs +++ b/build.rs @@ -848,7 +848,8 @@ fn maybe_symlink_root_dir(dirs: &mut Dirs) { Ok(existing) if existing == target => break, Ok(_) => remove_dir(symlink).expect("remove_dir failed"), Err(_) => { - break symlink_dir(target, symlink).expect("symlink_dir failed") + let _ = remove_dir(symlink); + break symlink_dir(target, symlink).expect("symlink_dir failed"); } } }