diff options
| author | Max Wase <max.vvase@gmail.com> | 2021-05-27 16:04:08 +0300 |
|---|---|---|
| committer | Max Wase <max.vvase@gmail.com> | 2021-05-27 16:04:08 +0300 |
| commit | 89c0f50b09e1f37b605f262aa8ffd3d2f4ee1c18 (patch) | |
| tree | cdfcd75ce9553e2e3cb3a1cdf80c69f954e1d427 /library/std/src/path.rs | |
| parent | e1cf38fa8932b8961c03338b585138c610c4cec4 (diff) | |
| download | rust-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.rs | 5 |
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 |
