Skip to content

Commit bfa0bfd

Browse files
committed
Rollup merge of rust-lang#27164 - steveklabnik:doc_io_utils, r=alexcrichton
These provide various special readers, so point their docs to their constructor functions in a manner consistent with everything else. r? @alexcrichton
2 parents 579045c + 7e7ec6b commit bfa0bfd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/libstd/io/util.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ pub fn copy<R: Read, W: Write>(reader: &mut R, writer: &mut W) -> io::Result<u64
6161
}
6262

6363
/// A reader which is always at EOF.
64+
///
65+
/// This struct is generally created by calling [`empty()`][empty]. Please see
66+
/// the documentation of `empty()` for more details.
67+
///
68+
/// [empty]: fn.empty.html
6469
#[stable(feature = "rust1", since = "1.0.0")]
6570
pub struct Empty { _priv: () }
6671

@@ -95,7 +100,12 @@ impl BufRead for Empty {
95100
fn consume(&mut self, _n: usize) {}
96101
}
97102

98-
/// A reader which infinitely yields one byte.
103+
/// A reader which yields one byte over and over and over and over and over and...
104+
///
105+
/// This struct is generally created by calling [`repeat()`][repeat]. Please
106+
/// see the documentation of `repeat()` for more details.
107+
///
108+
/// [empty]: fn.repeat.html
99109
#[stable(feature = "rust1", since = "1.0.0")]
100110
pub struct Repeat { byte: u8 }
101111

@@ -117,6 +127,11 @@ impl Read for Repeat {
117127
}
118128

119129
/// A writer which will move data into the void.
130+
///
131+
/// This struct is generally created by calling [`sink()`][sink]. Please
132+
/// see the documentation of `sink()` for more details.
133+
///
134+
/// [empty]: fn.sink.html
120135
#[stable(feature = "rust1", since = "1.0.0")]
121136
pub struct Sink { _priv: () }
122137

0 commit comments

Comments
 (0)