summary refs log tree commit diff
path: root/library/std/src/path.rs
diff options
context:
space:
mode:
authorMax Wase <max.vvase@gmail.com>2021-05-27 16:04:08 +0300
committerMax Wase <max.vvase@gmail.com>2021-05-27 16:04:08 +0300
commit89c0f50b09e1f37b605f262aa8ffd3d2f4ee1c18 (patch)
treecdfcd75ce9553e2e3cb3a1cdf80c69f954e1d427 /library/std/src/path.rs
parente1cf38fa8932b8961c03338b585138c610c4cec4 (diff)
downloadrust-89c0f50b09e1f37b605f262aa8ffd3d2f4ee1c18.tar.gz
rust-89c0f50b09e1f37b605f262aa8ffd3d2f4ee1c18.zip
Fix `is_symlink()` method for `Path` using added `is_symlink()` method for `Metadata`
Diffstat (limited to 'library/std/src/path.rs')
-rw-r--r--library/std/src/path.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index efee31f9915..2023a8448aa 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2588,10 +2588,9 @@ impl Path {
     /// assert_eq!(link_path.is_symlink(), true);
     /// assert_eq!(link_path.exists(), false);
     /// ```
-    #[unstable(feature = "path_ext", issue = "none")]
-    #[inline]
+    #[unstable(feature = "is_symlink", issue = "none")]
     pub fn is_symlink(&self) -> bool {
-        fs::symlink_metadata(self).is_ok()
+        fs::symlink_metadata(self).map(|m| m.is_symlink()).unwrap_or(false)
     }
 
     /// Converts a [`Box<Path>`](Box) into a [`PathBuf`] without copying or