fix: fs::remove_dir_all: treat ENOENT as success

fixes #127576

windows implementation still needs some work
This commit is contained in:
binarycat
2024-07-11 15:44:58 -04:00
parent 5367673014
commit 736f773844
8 changed files with 153 additions and 36 deletions

View File

@@ -80,3 +80,11 @@ pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 {
// r < denom, so (denom*numer) is the upper bound of (r*numer)
q * numer + r * numer / denom
}
pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {
match result {
Err(err) if err.kind() == crate::io::ErrorKind::NotFound => Ok(()),
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}