1
Fork 0

Rollup merge of #133673 - onur-ozkan:windows-fixme, r=Kobzol

replace hard coded error id with `ErrorKind::DirectoryNotEmpty`

Resolves an internal bootstrap FIXME.
This commit is contained in:
Ralf Jung 2024-11-30 19:24:43 +01:00 committed by GitHub
commit bdb44d0227
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
});
}