Skip to content

Commit

Permalink
replace hard coded error id with ErrorKind::DirectoryNotEmpty
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Nov 30, 2024
1 parent 76f3ff6 commit fd90198
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/bootstrap/src/core/build_steps/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand Down

0 comments on commit fd90198

Please sign in to comment.