]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/path.rs
Rollup merge of #34475 - frewsxcv:path-component, r=GuillaumeGomez
[rust.git] / src / libstd / path.rs
index e020945011af29dec51f4a4611a4f23a6291188b..c103ff7f4b025345a260fd586f01eb01829b643e 100644 (file)
@@ -599,6 +599,8 @@ fn as_ref(&self) -> &OsStr {
 /// See the module documentation for an in-depth explanation of components and
 /// their role in the API.
 ///
+/// This `struct` is created by the [`path::Path::components`] method.
+///
 /// # Examples
 ///
 /// ```
@@ -610,6 +612,8 @@ fn as_ref(&self) -> &OsStr {
 ///     println!("{:?}", component);
 /// }
 /// ```
+///
+/// [`path::Path::components`]: struct.Path.html#method.components
 #[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Components<'a> {
@@ -1801,7 +1805,9 @@ pub fn display(&self) -> Display {
     /// 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)
@@ -1809,7 +1815,9 @@ pub fn metadata(&self) -> io::Result<fs::Metadata> {
 
     /// 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)
@@ -1818,7 +1826,9 @@ pub fn symlink_metadata(&self) -> io::Result<fs::Metadata> {
     /// 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)
@@ -1826,7 +1836,9 @@ pub fn canonicalize(&self) -> io::Result<PathBuf> {
 
     /// 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)
@@ -1837,7 +1849,9 @@ pub fn read_link(&self) -> io::Result<PathBuf> {
     /// 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)