From 0e0584f290b5194e790a5d324cbab55a975ce714 Mon Sep 17 00:00:00 2001 From: Rob Young Date: Sat, 27 Jun 2020 19:32:19 +0100 Subject: [PATCH] Add links to fs::DirEntry::metadata `fs::DirEntry::metadata` doesn't traverse symlinks. It is not immediately clear what to do if you do want to traverse symlinks. This change adds links to the two other `metadata` functions that will follow symlinks. --- src/libstd/fs.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index f4c164a324e32..2a081fa65ca0e 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1429,7 +1429,10 @@ impl DirEntry { /// Returns the metadata for the file that this entry points at. /// /// This function will not traverse symlinks if this entry points at a - /// symlink. + /// symlink. To traverse symlinks use [`fs::metadata`] or [`fs::File::metadata`]. + /// + /// [`fs::metadata`]: fn.metadata.html + /// [`fs::File::metadata`]: struct.File.html#method.metadata /// /// # Platform-specific behavior ///