From 36e050b85f5fc9acd27ff5e8cda57a36070f43e2 Mon Sep 17 00:00:00 2001 From: Max Wase Date: Tue, 12 Oct 2021 08:01:24 +0300 Subject: Update library/std/src/path.rs Co-authored-by: Jane Lusby --- library/std/src/path.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'library/std/src') diff --git a/library/std/src/path.rs b/library/std/src/path.rs index a5b73c2580b..4a0df915212 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -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) -- cgit 1.4.1-3-g733a5