Skip to content

rm: remove remove_dir_all dependency #4335

@tertsdiepraam

Description

@tertsdiepraam

rm contains this bit of code, written back in July 2017:

use remove_dir_all::remove_dir_all;

// -- snip --

// we need the extra crate because apparently fs::remove_dir_all() does not function
// correctly on Windows
if let Err(e) = remove_dir_all(path) {
    had_err = true;
    if e.kind() == std::io::ErrorKind::PermissionDenied {
        // GNU compatibility (rm/fail-eacces.sh)
        // here, GNU doesn't use some kind of remove_dir_all
        // It will show directory+file
        show_error!("cannot remove {}: {}", path.quote(), "Permission denied");
    } else {
        show_error!("cannot remove {}: {}", path.quote(), e);
    }
}

It seems though that std::fs::remove_dir_all has had some improvements in the meantime (see rust-lang/cargo#11333), so I think it's safe to remove this dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions