@@ -560,14 +560,20 @@ impl OpenOptions {
560
560
///
561
561
/// One maybe obvious note when using append-mode: make sure that all data
562
562
/// that belongs together is written to the file in one operation. This
563
- /// can be done by concatenating strings before passing them to `write()`,
563
+ /// can be done by concatenating strings before passing them to [ `write()`] ,
564
564
/// or using a buffered writer (with a buffer of adequate size),
565
- /// and calling `flush()` when the message is complete.
565
+ /// and calling [ `flush()`] when the message is complete.
566
566
///
567
567
/// If a file is opened with both read and append access, beware that after
568
568
/// opening, and after every write, the position for reading may be set at the
569
569
/// end of the file. So, before writing, save the current position (using
570
- /// `seek(SeekFrom::Current(0))`, and restore it before the next read.
570
+ /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`, and restore it before the next read.
571
+ ///
572
+ /// [`write()`]: ../../std/fs/struct.File.html#method.write
573
+ /// [`flush()`]: ../../std/fs/struct.File.html#method.flush
574
+ /// [`seek`]: ../../std/fs/struct.File.html#method.seek
575
+ /// [`SeekFrom`]: ../../std/io/enum.SeekFrom.html
576
+ /// [`Current`]: ../../std/io/enum.SeekFrom.html#variant.Current
571
577
///
572
578
/// # Examples
573
579
///
@@ -605,9 +611,12 @@ impl OpenOptions {
605
611
/// This option indicates whether a new file will be created if the file
606
612
/// does not yet already exist.
607
613
///
608
- /// In order for the file to be created, `write` or `append` access must
614
+ /// In order for the file to be created, [ `write`] or [ `append`] access must
609
615
/// be used.
610
616
///
617
+ /// [`write`]: #method.write
618
+ /// [`append`]: #method.append
619
+ ///
611
620
/// # Examples
612
621
///
613
622
/// ```no_run
@@ -630,12 +639,15 @@ impl OpenOptions {
630
639
/// whether a file exists and creating a new one, the file may have been
631
640
/// created by another process (a TOCTOU race condition / attack).
632
641
///
633
- /// If `.create_new(true)` is set, `.create()` and `.truncate()` are
642
+ /// If `.create_new(true)` is set, [ `.create()`] and [ `.truncate()`] are
634
643
/// ignored.
635
644
///
636
645
/// The file must be opened with write or append access in order to create
637
646
/// a new file.
638
647
///
648
+ /// [`.create()`]: #method.create
649
+ /// [`.truncate()`]: #method.truncate
650
+ ///
639
651
/// # Examples
640
652
///
641
653
/// ```no_run
0 commit comments