-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 documentation of remove_dir errors #75324
Conversation
remove_dir will error if the path doesn't exist or isn't a directory. It's useful to clarify that this is "remove dir or fail" not "remove dir if it exists". I don't think this belongs in the title. "Removes an existing, empty directory" is strangely worded-- there's no such thing as a non-existing directory. Better to just say explicitly it will return an error.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @shepmaster (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Note: a similar change was recently added to the docs for remove_file (see c4e44d7). I think the two should be consistent about documenting the "doesn't exist" case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This PR is inactive for a week or so, let's r? @Mark-Simulacrum, I think it's good to go. |
@bors r=JohnTitor rollup |
📌 Commit f85d231 has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#75324 (clarify documentation of remove_dir errors) - rust-lang#75532 (Fix RFC-1014 test) - rust-lang#75664 (Update mailmap for mati865) - rust-lang#75727 (Switch to intra-doc links in `core::result`) - rust-lang#75750 (Move to intra doc links for std::thread documentation) Failed merges: r? @ghost
remove_dir will error if the path doesn't exist or isn't a directory.
It's useful to clarify that this is "remove dir or fail" not "remove dir
if it exists".
I don't think this belongs in the title. "Removes an existing, empty
directory" is strangely worded-- there's no such thing as a non-existing
directory. Better to just say explicitly it will return an error.