add a comment to explain the why

This commit is contained in:
Sylvestre Ledru 2021-05-30 09:16:46 +02:00 committed by GitHub
parent 5b417e251d
commit 83bb8795bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,6 +108,7 @@ fn remove_dir(path: &Path, ignore: bool, verbose: bool) -> Result<(), i32> {
let mut read_dir = match fs::read_dir(path) {
Ok(m) => m,
Err(e) if e.raw_os_error() == Some(ENOTDIR) => {
// To match the GNU output
show_error!("failed to remove '{}': Not a directory", path.display());
return Err(1);
}