Skip to content

Commit 36e050b

Browse files
maxwaseyaahc
andauthored
Update library/std/src/path.rs
Co-authored-by: Jane Lusby <[email protected]>
1 parent 55663a7 commit 36e050b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/std/src/path.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,12 @@ impl Path {
27432743
/// assert_eq!(link_path.is_symlink(), true);
27442744
/// assert_eq!(link_path.exists(), false);
27452745
/// ```
2746+
///
2747+
/// # See Also
2748+
///
2749+
/// This is a convenience function that coerces errors to false. If you want to
2750+
/// check errors, call [`fs::symlink_metadata`] and handle its [`Result`]. Then call
2751+
/// [`fs::Metadata::is_symlink`] if it was [`Ok`].
27462752
#[stable(feature = "is_symlink", since = "1.57.0")]
27472753
pub fn is_symlink(&self) -> bool {
27482754
fs::symlink_metadata(self).map(|m| m.is_symlink()).unwrap_or(false)

0 commit comments

Comments
 (0)