about summary refs log tree commit diff
path: root/src/libstd/fs.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-09-13 14:46:15 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-09-13 14:46:15 +0200
commitccd4689ca3bb7742439255ee5a8411cd6103e8f0 (patch)
tree9bba3269c130b1f82e53f061cc07d32cd7c5e6da /src/libstd/fs.rs
parent7e5578da8c76fafcb1d7ca9f0643127da76f0879 (diff)
downloadrust-ccd4689ca3bb7742439255ee5a8411cd6103e8f0.tar.gz
rust-ccd4689ca3bb7742439255ee5a8411cd6103e8f0.zip
Add missing urls for OpenOptions docs
Diffstat (limited to 'src/libstd/fs.rs')
-rw-r--r--src/libstd/fs.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index a438b4afdd0..6014e765284 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -560,14 +560,20 @@ impl OpenOptions {
     ///
     /// One maybe obvious note when using append-mode: make sure that all data
     /// that belongs together is written to the file in one operation. This
-    /// can be done by concatenating strings before passing them to `write()`,
+    /// can be done by concatenating strings before passing them to [`write()`],
     /// or using a buffered writer (with a buffer of adequate size),
-    /// and calling `flush()` when the message is complete.
+    /// and calling [`flush()`] when the message is complete.
     ///
     /// If a file is opened with both read and append access, beware that after
     /// opening, and after every write, the position for reading may be set at the
     /// end of the file. So, before writing, save the current position (using
-    /// `seek(SeekFrom::Current(0))`, and restore it before the next read.
+    /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`, and restore it before the next read.
+    ///
+    /// [`write()`]: ../../std/fs/struct.File.html#method.write
+    /// [`flush()`]: ../../std/fs/struct.File.html#method.flush
+    /// [`seek`]: ../../std/fs/struct.File.html#method.seek
+    /// [`SeekFrom`]: ../../std/io/enum.SeekFrom.html
+    /// [`Current`]: ../../std/io/enum.SeekFrom.html#variant.Current
     ///
     /// # Examples
     ///
@@ -605,9 +611,12 @@ impl OpenOptions {
     /// This option indicates whether a new file will be created if the file
     /// does not yet already exist.
     ///
-    /// In order for the file to be created, `write` or `append` access must
+    /// In order for the file to be created, [`write`] or [`append`] access must
     /// be used.
     ///
+    /// [`write`]: #method.write
+    /// [`append`]: #method.append
+    ///
     /// # Examples
     ///
     /// ```no_run
@@ -630,12 +639,15 @@ impl OpenOptions {
     /// whether a file exists and creating a new one, the file may have been
     /// created by another process (a TOCTOU race condition / attack).
     ///
-    /// If `.create_new(true)` is set, `.create()` and `.truncate()` are
+    /// If `.create_new(true)` is set, [`.create()`] and [`.truncate()`] are
     /// ignored.
     ///
     /// The file must be opened with write or append access in order to create
     /// a new file.
     ///
+    /// [`.create()`]: #method.create
+    /// [`.truncate()`]: #method.truncate
+    ///
     /// # Examples
     ///
     /// ```no_run