From fd9019852e2e54f5b35b40c7c6b8af237dd405b2 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sat, 30 Nov 2024 12:40:43 +0300 Subject: [PATCH] replace hard coded error id with `ErrorKind::DirectoryNotEmpty` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/clean.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/clean.rs b/src/bootstrap/src/core/build_steps/clean.rs index d857de96cce73..61cc9eeed5555 100644 --- a/src/bootstrap/src/core/build_steps/clean.rs +++ b/src/bootstrap/src/core/build_steps/clean.rs @@ -203,10 +203,8 @@ fn rm_rf(path: &Path) { do_op(path, "remove dir", |p| match fs::remove_dir(p) { // Check for dir not empty on Windows - // FIXME: Once `ErrorKind::DirectoryNotEmpty` is stabilized, - // match on `e.kind()` instead. #[cfg(windows)] - Err(e) if e.raw_os_error() == Some(145) => Ok(()), + Err(e) if e.kind() == ErrorKind::DirectoryNotEmpty => Ok(()), r => r, }); }