@@ -1154,10 +1154,7 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
1154
1154
///
1155
1155
/// For example, reading line-by-line is inefficient without using a buffer, so
1156
1156
/// if you want to read by line, you'll need `BufRead`, which includes a
1157
- /// [`read_line()`][readline] method as well as a [`lines()`][lines] iterator.
1158
- ///
1159
- /// [readline]: #method.read_line
1160
- /// [lines]: #method.lines
1157
+ /// [`read_line()`] method as well as a [`lines()`] iterator.
1161
1158
///
1162
1159
/// # Examples
1163
1160
///
@@ -1173,14 +1170,17 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
1173
1170
/// }
1174
1171
/// ```
1175
1172
///
1176
- /// If you have something that implements `Read`, you can use the [`BufReader`
1177
- /// type][bufreader ] to turn it into a `BufRead`.
1173
+ /// If you have something that implements [ `Read`] , you can use the [`BufReader`
1174
+ /// type][`BufReader` ] to turn it into a `BufRead`.
1178
1175
///
1179
- /// For example, [`File`][file] implements `Read`, but not `BufRead`.
1180
- /// `BufReader` to the rescue!
1176
+ /// For example, [`File`] implements [ `Read`] , but not `BufRead`.
1177
+ /// [ `BufReader`] to the rescue!
1181
1178
///
1182
- /// [bufreader]: struct.BufReader.html
1183
- /// [file]: ../fs/struct.File.html
1179
+ /// [`BufReader`]: struct.BufReader.html
1180
+ /// [`File`]: ../fs/struct.File.html
1181
+ /// [`read_line()`]: #method.read_line
1182
+ /// [`lines()`]: #method.lines
1183
+ /// [`Read`]: trait.Read.html
1184
1184
///
1185
1185
/// ```
1186
1186
/// use std::io::{self, BufReader};
@@ -1204,13 +1204,13 @@ pub trait BufRead: Read {
1204
1204
/// Fills the internal buffer of this object, returning the buffer contents.
1205
1205
///
1206
1206
/// This function is a lower-level call. It needs to be paired with the
1207
- /// [`consume`][consume ] method to function properly. When calling this
1207
+ /// [`consume()` ] method to function properly. When calling this
1208
1208
/// method, none of the contents will be "read" in the sense that later
1209
- /// calling `read` may return the same contents. As such, `consume` must be
1210
- /// called with the number of bytes that are consumed from this buffer to
1209
+ /// calling `read` may return the same contents. As such, [ `consume()`] must
1210
+ /// be called with the number of bytes that are consumed from this buffer to
1211
1211
/// ensure that the bytes are never returned twice.
1212
1212
///
1213
- /// [consume]: #tymethod.consume
1213
+ /// [` consume()` ]: #tymethod.consume
1214
1214
///
1215
1215
/// An empty buffer returned indicates that the stream has reached EOF.
1216
1216
///
@@ -1251,21 +1251,21 @@ pub trait BufRead: Read {
1251
1251
/// so they should no longer be returned in calls to `read`.
1252
1252
///
1253
1253
/// This function is a lower-level call. It needs to be paired with the
1254
- /// [`fill_buf`][fillbuf ] method to function properly. This function does
1254
+ /// [`fill_buf()` ] method to function properly. This function does
1255
1255
/// not perform any I/O, it simply informs this object that some amount of
1256
- /// its buffer, returned from `fill_buf`, has been consumed and should no
1257
- /// longer be returned. As such, this function may do odd things if
1258
- /// `fill_buf` isn't called before calling it.
1259
- ///
1260
- /// [fillbuf]: #tymethod.fill_buf
1256
+ /// its buffer, returned from [`fill_buf()`], has been consumed and should
1257
+ /// no longer be returned. As such, this function may do odd things if
1258
+ /// [`fill_buf()`] isn't called before calling it.
1261
1259
///
1262
1260
/// The `amt` must be `<=` the number of bytes in the buffer returned by
1263
- /// `fill_buf` .
1261
+ /// [ `fill_buf()`] .
1264
1262
///
1265
1263
/// # Examples
1266
1264
///
1267
- /// Since `consume()` is meant to be used with [`fill_buf()`][fillbuf] ,
1265
+ /// Since `consume()` is meant to be used with [`fill_buf()`],
1268
1266
/// that method's example includes an example of `consume()`.
1267
+ ///
1268
+ /// [`fill_buf()`]: #tymethod.fill_buf
1269
1269
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1270
1270
fn consume ( & mut self , amt : usize ) ;
1271
1271
@@ -1279,8 +1279,8 @@ pub trait BufRead: Read {
1279
1279
///
1280
1280
/// # Errors
1281
1281
///
1282
- /// This function will ignore all instances of `ErrorKind::Interrupted` and
1283
- /// will otherwise return any errors returned by `fill_buf` .
1282
+ /// This function will ignore all instances of [ `ErrorKind::Interrupted`] and
1283
+ /// will otherwise return any errors returned by [ `fill_buf()`] .
1284
1284
///
1285
1285
/// If an I/O error is encountered then all bytes read so far will be
1286
1286
/// present in `buf` and its length will have been adjusted appropriately.
@@ -1290,6 +1290,9 @@ pub trait BufRead: Read {
1290
1290
/// A locked standard input implements `BufRead`. In this example, we'll
1291
1291
/// read from standard input until we see an `a` byte.
1292
1292
///
1293
+ /// [`fill_buf()`]: #tymethod.fill_buf
1294
+ /// [`ErrorKind::Interrupted`]: enum.ErrorKind.html#variant.Interrupted
1295
+ ///
1293
1296
/// ```
1294
1297
/// use std::io;
1295
1298
/// use std::io::prelude::*;
@@ -1322,19 +1325,20 @@ pub trait BufRead: Read {
1322
1325
///
1323
1326
/// # Errors
1324
1327
///
1325
- /// This function has the same error semantics as `read_until` and will also
1326
- /// return an error if the read bytes are not valid UTF-8. If an I/O error
1327
- /// is encountered then `buf` may contain some bytes already read in the
1328
- /// event that all data read so far was valid UTF-8.
1328
+ /// This function has the same error semantics as [ `read_until()`] and will
1329
+ /// also return an error if the read bytes are not valid UTF-8. If an I/O
1330
+ /// error is encountered then `buf` may contain some bytes already read in
1331
+ /// the event that all data read so far was valid UTF-8.
1329
1332
///
1330
1333
/// # Examples
1331
1334
///
1332
1335
/// A locked standard input implements `BufRead`. In this example, we'll
1333
1336
/// read all of the lines from standard input. If we were to do this in
1334
- /// an actual project, the [`lines()`][lines] method would be easier, of
1337
+ /// an actual project, the [`lines()`] method would be easier, of
1335
1338
/// course.
1336
1339
///
1337
- /// [lines]: #method.lines
1340
+ /// [`lines()`]: #method.lines
1341
+ /// [`read_until()`]: #method.read_until
1338
1342
///
1339
1343
/// ```
1340
1344
/// use std::io;
@@ -1363,17 +1367,21 @@ pub trait BufRead: Read {
1363
1367
/// `byte`.
1364
1368
///
1365
1369
/// The iterator returned from this function will return instances of
1366
- /// `io::Result< Vec<u8>>`. Each vector returned will *not* have the
1367
- /// delimiter byte at the end.
1370
+ /// [ `io::Result`]`<`[` Vec<u8>`]` >`. Each vector returned will *not* have
1371
+ /// the delimiter byte at the end.
1368
1372
///
1369
- /// This function will yield errors whenever `read_until` would have also
1370
- /// yielded an error.
1373
+ /// This function will yield errors whenever [ `read_until()`] would have
1374
+ /// also yielded an error.
1371
1375
///
1372
1376
/// # Examples
1373
1377
///
1374
1378
/// A locked standard input implements `BufRead`. In this example, we'll
1375
1379
/// read some input from standard input, splitting on commas.
1376
1380
///
1381
+ /// [`io::Result`]: type.Result.html
1382
+ /// [`Vec<u8>`]: ../vec/struct.Vec.html
1383
+ /// [`read_until()`]: #method.read_until
1384
+ ///
1377
1385
/// ```
1378
1386
/// use std::io;
1379
1387
/// use std::io::prelude::*;
@@ -1392,9 +1400,12 @@ pub trait BufRead: Read {
1392
1400
/// Returns an iterator over the lines of this reader.
1393
1401
///
1394
1402
/// The iterator returned from this function will yield instances of
1395
- /// `io::Result< String>`. Each string returned will *not* have a newline
1403
+ /// [ `io::Result`]`<`[` String`]` >`. Each string returned will *not* have a newline
1396
1404
/// byte (the 0xA byte) or CRLF (0xD, 0xA bytes) at the end.
1397
1405
///
1406
+ /// [`io::Result`]: type.Result.html
1407
+ /// [`String`]: ../string/struct.String.html
1408
+ ///
1398
1409
/// # Examples
1399
1410
///
1400
1411
/// A locked standard input implements `BufRead`:
@@ -1417,10 +1428,10 @@ pub trait BufRead: Read {
1417
1428
1418
1429
/// Adaptor to chain together two readers.
1419
1430
///
1420
- /// This struct is generally created by calling [`chain()`][chain] on a reader.
1421
- /// Please see the documentation of `chain()` for more details.
1431
+ /// This struct is generally created by calling [`chain()`] on a reader.
1432
+ /// Please see the documentation of [ `chain()`] for more details.
1422
1433
///
1423
- /// [chain]: trait.Read.html#method.chain
1434
+ /// [` chain()` ]: trait.Read.html#method.chain
1424
1435
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1425
1436
pub struct Chain < T , U > {
1426
1437
first : T ,
@@ -1581,10 +1592,10 @@ fn read_one_byte(reader: &mut Read) -> Option<Result<u8>> {
1581
1592
1582
1593
/// An iterator over `u8` values of a reader.
1583
1594
///
1584
- /// This struct is generally created by calling [`bytes()`][bytes] on a reader.
1585
- /// Please see the documentation of `bytes()` for more details.
1595
+ /// This struct is generally created by calling [`bytes()`] on a reader.
1596
+ /// Please see the documentation of [ `bytes()`] for more details.
1586
1597
///
1587
- /// [bytes]: trait.Read.html#method.bytes
1598
+ /// [` bytes()` ]: trait.Read.html#method.bytes
1588
1599
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1589
1600
pub struct Bytes < R > {
1590
1601
inner : R ,
0 commit comments