-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify that calling fs::remove_dir_all on a file is an error #137230
Comments
EDIT: wait I'm dumb, I just added that locally 💀 Though I do want to slightly reformat the caveats to make it easier to spot on a quick glance. |
Oh wait, this line exists on nightly std docs but not yet stable, which is why I'm so confused. It is indeed present already at https://doc.rust-lang.org/nightly/std/fs/fn.remove_dir_all.html. I'm going to close this as the core request "documenting it will fail on not-a-directory" is satisfied, I'll send a follow-up to slightly reformat the error docs. |
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
Rollup merge of rust-lang#137240 - jieyouxu:remove_dir_all, r=Mark-Simulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
…mulacrum Slightly reformat `std::fs::remove_dir_all` error docs To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀 cc rust-lang#137230.
Location
https://doc.rust-lang.org/stable/std/fs/fn.remove_dir_all.html
Summary
Add to the errors section "if the passed path is a regular file, this function returns
NotADirectory
". This clarifies that it is not the same operation asrm -r
, and also specifies which error will be returned in this case.The text was updated successfully, but these errors were encountered: