Skip to content

Commit

Permalink
Update library/std/src/path.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
  • Loading branch information
maxwase and yaahc committed Oct 12, 2021
1 parent 55663a7 commit 36e050b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,12 @@ impl Path {
/// assert_eq!(link_path.is_symlink(), true);
/// assert_eq!(link_path.exists(), false);
/// ```
///
/// # See Also
///
/// This is a convenience function that coerces errors to false. If you want to
/// check errors, call [`fs::symlink_metadata`] and handle its [`Result`]. Then call
/// [`fs::Metadata::is_symlink`] if it was [`Ok`].
#[stable(feature = "is_symlink", since = "1.57.0")]
pub fn is_symlink(&self) -> bool {
fs::symlink_metadata(self).map(|m| m.is_symlink()).unwrap_or(false)
Expand Down

0 comments on commit 36e050b

Please sign in to comment.