-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use fs::symlink_metadata in doc for is_symlink #39176
Conversation
fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue rust-lang#39088.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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. |
Somewhat related, the docs for EDIT: fix link |
@@ -975,13 +975,18 @@ impl FileType { | |||
|
|||
/// Test whether this file type represents a symbolic link. | |||
/// | |||
/// The Metadata struct needs to be retreived with |
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.
This place wants more inline-code annotations, so it looks like
retrieved with
fs::symlink_metadata()
notfs::metadata()
.
and not
retrieved with fs::symlink_metadata() not fs::metadata().
You can achieve that enclosing the inline code snippets within the grave (`) symbols. Like this:
retrieved with `fs::symlink_metadata()` not `fs::metadata()`.
@@ -975,13 +975,18 @@ impl FileType { | |||
|
|||
/// Test whether this file type represents a symbolic link. | |||
/// | |||
/// The Metadata struct needs to be retreived with |
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.
"retreived" -> "retrieved" maybe?
@@ -975,13 +975,18 @@ impl FileType { | |||
|
|||
/// Test whether this file type represents a symbolic link. | |||
/// | |||
/// The Metadata struct needs to be retreived with | |||
/// fs::symlink_metadata() not fs::metadata(). metadata() |
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.
Missing urls.
@bors: r+ Thanks @CartesianDaemon! |
📌 Commit fe9f5d5 has been approved by |
Thank you for your help! |
@bors rollup |
⌛ Testing commit fe9f5d5 with merge 09a7eae... |
💔 Test failed - status-appveyor |
@bors retry
|
☔ The latest upstream changes (presumably #39203) made this pull request unmergeable. Please resolve the merge conflicts. |
This reverts commit fe9f5d5.
@CartesianDaemon Any reason for that last commit where you got rid of the link? |
It looked to me like the duplicate patch (#39203) got merged before this, so it's a conflict and I need to not make that change (or rebase off the more recent master). Is there a better thing to do? |
Ah, that make sense. Thanks for your contribution! @bors r+ rollup |
📌 Commit f55bbaa has been approved by |
Thanks! |
Use fs::symlink_metadata in doc for is_symlink fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
☀️ Test successful - status-appveyor, status-travis |
fs::metadata() follows symlinks so is_symlink() will always return
false. Use symlink_metadata instead in the example in the
documentation.
See issue #39088.