Skip to content

Commit dad29a6

Browse files
Add missing links
1 parent 2c50f4e commit dad29a6

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

src/libstd/fs.rs

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,37 @@ pub struct File {
5858

5959
/// Metadata information about a file.
6060
///
61-
/// This structure is returned from the `metadata` function or method and
61+
/// This structure is returned from the [`metadata`] function or method and
6262
/// represents known metadata about a file such as its permissions, size,
6363
/// modification times, etc.
64+
///
65+
/// [`metadata`]: fn.metadata.html
6466
#[stable(feature = "rust1", since = "1.0.0")]
6567
#[derive(Clone)]
6668
pub struct Metadata(fs_imp::FileAttr);
6769

6870
/// Iterator over the entries in a directory.
6971
///
70-
/// This iterator is returned from the `read_dir` function of this module and
71-
/// will yield instances of `io::Result<DirEntry>`. Through a `DirEntry`
72+
/// This iterator is returned from the [`read_dir`] function of this module and
73+
/// will yield instances of `io::Result<DirEntry>`. Through a [`DirEntry`]
7274
/// information like the entry's path and possibly other metadata can be
7375
/// learned.
7476
///
77+
/// [`read_dir`]: fn.read_dir.html
78+
/// [`DirEntry`]: struct.DirEntry.html
79+
///
7580
/// # Errors
7681
///
77-
/// This `io::Result` will be an `Err` if there's some sort of intermittent
82+
/// This [`io::Result`] will be an `Err` if there's some sort of intermittent
7883
/// IO error during iteration.
84+
///
85+
/// [`io::Result`]: ../io/type.Result.html
7986
#[stable(feature = "rust1", since = "1.0.0")]
8087
pub struct ReadDir(fs_imp::ReadDir);
8188

82-
/// Entries returned by the `ReadDir` iterator.
89+
/// Entries returned by the [`ReadDir`] iterator.
90+
///
91+
/// [`ReadDir`]: struct.ReadDir.html
8392
///
8493
/// An instance of `DirEntry` represents an entry inside of a directory on the
8594
/// filesystem. Each entry can be inspected via methods to learn about the full
@@ -89,17 +98,23 @@ pub struct DirEntry(fs_imp::DirEntry);
8998

9099
/// Options and flags which can be used to configure how a file is opened.
91100
///
92-
/// This builder exposes the ability to configure how a `File` is opened and
93-
/// what operations are permitted on the open file. The `File::open` and
94-
/// `File::create` methods are aliases for commonly used options using this
101+
/// This builder exposes the ability to configure how a [`File`] is opened and
102+
/// what operations are permitted on the open file. The [`File::open`] and
103+
/// [`File::create`] methods are aliases for commonly used options using this
95104
/// builder.
96105
///
97-
/// Generally speaking, when using `OpenOptions`, you'll first call `new()`,
98-
/// then chain calls to methods to set each option, then call `open()`, passing
99-
/// the path of the file you're trying to open. This will give you a
106+
/// [`File`]: struct.File.html
107+
/// [`File::open`]: struct.File.html#method.open
108+
/// [`File::create`]: struct.File.html#method.create
109+
///
110+
/// Generally speaking, when using `OpenOptions`, you'll first call [`new()`],
111+
/// then chain calls to methods to set each option, then call [`open()`],
112+
/// passing the path of the file you're trying to open. This will give you a
100113
/// [`io::Result`][result] with a [`File`][file] inside that you can further
101114
/// operate on.
102115
///
116+
/// [`new()`]: struct.OpenOptions.html#method.new
117+
/// [`open()`]: struct.OpenOptions.html#method.open
103118
/// [result]: ../io/type.Result.html
104119
/// [file]: struct.File.html
105120
///
@@ -131,10 +146,12 @@ pub struct OpenOptions(fs_imp::OpenOptions);
131146

132147
/// Representation of the various permissions on a file.
133148
///
134-
/// This module only currently provides one bit of information, `readonly`,
149+
/// This module only currently provides one bit of information, [`readonly`],
135150
/// which is exposed on all currently supported platforms. Unix-specific
136151
/// functionality, such as mode bits, is available through the
137152
/// `os::unix::PermissionsExt` trait.
153+
///
154+
/// [`readonly`]: struct.Permissions.html#method.readonly
138155
#[derive(Clone, PartialEq, Eq, Debug)]
139156
#[stable(feature = "rust1", since = "1.0.0")]
140157
pub struct Permissions(fs_imp::FilePermissions);

0 commit comments

Comments
 (0)