Skip to content

Commit 27fc0f2

Browse files
committed
Document iterators in std::io
Make them all consistent and link up the documentation.
1 parent 4e51763 commit 27fc0f2

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

src/libstd/io/mod.rs

+28-11
Original file line numberDiff line numberDiff line change
@@ -1188,9 +1188,12 @@ impl<T: Write, U: Write> Write for Broadcast<T, U> {
11881188
}
11891189
}
11901190

1191-
/// Adaptor to chain together two instances of `Read`.
1191+
/// Adaptor to chain together two readers.
11921192
///
1193-
/// For more information, see `Read::chain`.
1193+
/// This struct is generally created by calling [`chain()`][chain] on a reader.
1194+
/// Please see the documentation of `chain()` for more details.
1195+
///
1196+
/// [chain]: trait.Read.html#method.chain
11941197
#[stable(feature = "rust1", since = "1.0.0")]
11951198
pub struct Chain<T, U> {
11961199
first: T,
@@ -1266,7 +1269,10 @@ impl<T: BufRead> BufRead for Take<T> {
12661269

12671270
/// An adaptor which will emit all read data to a specified writer as well.
12681271
///
1269-
/// For more information see `Read::tee`
1272+
/// This struct is generally created by calling [`tee()`][tee] on a reader.
1273+
/// Please see the documentation of `tee()` for more details.
1274+
///
1275+
/// [tee]: trait.Read.html#method.tee
12701276
#[unstable(feature = "io", reason = "awaiting stability of Read::tee")]
12711277
pub struct Tee<R, W> {
12721278
reader: R,
@@ -1283,9 +1289,12 @@ impl<R: Read, W: Write> Read for Tee<R, W> {
12831289
}
12841290
}
12851291

1286-
/// A bridge from implementations of `Read` to an `Iterator` of `u8`.
1292+
/// An iterator over `u8` values of a reader.
1293+
///
1294+
/// This struct is generally created by calling [`bytes()`][bytes] on a reader.
1295+
/// Please see the documentation of `bytes()` for more details.
12871296
///
1288-
/// See `Read::bytes` for more information.
1297+
/// [bytes]: trait.Read.html#method.bytes
12891298
#[stable(feature = "rust1", since = "1.0.0")]
12901299
pub struct Bytes<R> {
12911300
inner: R,
@@ -1305,9 +1314,12 @@ impl<R: Read> Iterator for Bytes<R> {
13051314
}
13061315
}
13071316

1308-
/// A bridge from implementations of `Read` to an `Iterator` of `char`.
1317+
/// An iterator over the `char`s of a reader.
13091318
///
1310-
/// See `Read::chars` for more information.
1319+
/// This struct is generally created by calling [`chars()`][chars] on a reader.
1320+
/// Please see the documentation of `chars()` for more details.
1321+
///
1322+
/// [chars]: trait.Read.html#method.chars
13111323
#[unstable(feature = "io", reason = "awaiting stability of Read::chars")]
13121324
pub struct Chars<R> {
13131325
inner: R,
@@ -1389,7 +1401,10 @@ impl fmt::Display for CharsError {
13891401
/// An iterator over the contents of an instance of `BufRead` split on a
13901402
/// particular byte.
13911403
///
1392-
/// See `BufRead::split` for more information.
1404+
/// This struct is generally created by calling [`split()`][split] on a
1405+
/// `BufRead`. Please see the documentation of `split()` for more details.
1406+
///
1407+
/// [split]: trait.BufRead.html#method.split
13931408
#[stable(feature = "rust1", since = "1.0.0")]
13941409
pub struct Split<B> {
13951410
buf: B,
@@ -1415,10 +1430,12 @@ impl<B: BufRead> Iterator for Split<B> {
14151430
}
14161431
}
14171432

1418-
/// An iterator over the lines of an instance of `BufRead` split on a newline
1419-
/// byte.
1433+
/// An iterator over the lines of an instance of `BufRead`.
1434+
///
1435+
/// This struct is generally created by calling [`lines()`][lines] on a
1436+
/// `BufRead`. Please see the documentation of `lines()` for more details.
14201437
///
1421-
/// See `BufRead::lines` for more information.
1438+
/// [lines]: trait.BufRead.html#method.lines
14221439
#[stable(feature = "rust1", since = "1.0.0")]
14231440
pub struct Lines<B> {
14241441
buf: B,

0 commit comments

Comments
 (0)