Add reminder to match the error kind once DirectoryNotEmpty is stabilized

This commit is contained in:
Chris Denton 2021-12-09 14:39:30 +00:00
parent 913996b8ee
commit caed83d400
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE

View File

@ -75,6 +75,8 @@ fn rm_rf(path: &Path) {
do_op(path, "remove dir", |p| { do_op(path, "remove dir", |p| {
fs::remove_dir(p).or_else(|e| { fs::remove_dir(p).or_else(|e| {
// Check for dir not empty on Windows // Check for dir not empty on Windows
// FIXME: Once `ErrorKind::DirectoryNotEmpty` is stabilized,
// match on `e.kind()` instead.
#[cfg(windows)] #[cfg(windows)]
if e.raw_os_error() == Some(145) { if e.raw_os_error() == Some(145) {
return Ok(()); return Ok(());