Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,15 +1781,19 @@ impl Path {
/// This function will traverse symbolic links to query information about the
/// destination file.
///
/// This is an alias to `fs::metadata`.
/// This is an alias to [`fs::metadata`].
///
/// [`fs::metadata`]: ../fs/fn.metadata.html
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn metadata(&self) -> io::Result<fs::Metadata> {
fs::metadata(self)
}

/// Query the metadata about a file without following symlinks.
///
/// This is an alias to `fs::symlink_metadata`.
/// This is an alias to [`fs::symlink_metadata`].
///
/// [`fs::symlink_metadata`]: ../fs/fn.symlink_metadata.html
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn symlink_metadata(&self) -> io::Result<fs::Metadata> {
fs::symlink_metadata(self)
Expand All @@ -1798,15 +1802,19 @@ impl Path {
/// Returns the canonical form of the path with all intermediate components
/// normalized and symbolic links resolved.
///
/// This is an alias to `fs::canonicalize`.
/// This is an alias to [`fs::canonicalize`].
///
/// [`fs::canonicalize`]: ../fs/fn.canonicalize.html
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn canonicalize(&self) -> io::Result<PathBuf> {
fs::canonicalize(self)
}

/// Reads a symbolic link, returning the file that the link points to.
///
/// This is an alias to `fs::read_link`.
/// This is an alias to [`fs::read_link`].
///
/// [`fs::read_link`]: ../fs/fn.read_link.html
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn read_link(&self) -> io::Result<PathBuf> {
fs::read_link(self)
Expand All @@ -1817,7 +1825,9 @@ impl Path {
/// The iterator will yield instances of `io::Result<DirEntry>`. New errors may
/// be encountered after an iterator is initially constructed.
///
/// This is an alias to `fs::read_dir`.
/// This is an alias to [`fs::read_dir`].
///
/// [`fs::read_dir`]: ../fs/fn.read_dir.html
#[stable(feature = "path_ext", since = "1.5.0")]
pub fn read_dir(&self) -> io::Result<fs::ReadDir> {
fs::read_dir(self)
Expand Down