@@ -20,11 +20,15 @@ use memchr;
20
20
21
21
/// The `BufReader` struct adds buffering to any reader.
22
22
///
23
- /// It can be excessively inefficient to work directly with a `Read` instance.
24
- /// For example, every call to `read` on `TcpStream` results in a system call.
25
- /// A `BufReader` performs large, infrequent reads on the underlying `Read`
23
+ /// It can be excessively inefficient to work directly with a [ `Read`] instance.
24
+ /// For example, every call to [ `read`] on [ `TcpStream`] results in a system call.
25
+ /// A `BufReader` performs large, infrequent reads on the underlying [ `Read`]
26
26
/// and maintains an in-memory buffer of the results.
27
27
///
28
+ /// [`Read`]: ../../std/io/trait.Read.html
29
+ /// [`read`]: ../../std/net/struct.TcpStream.html#method.read
30
+ /// [`TcpStream`]: ../../std/net/struct.TcpStream.html
31
+ ///
28
32
/// # Examples
29
33
///
30
34
/// ```
@@ -254,15 +258,15 @@ impl<R: Seek> Seek for BufReader<R> {
254
258
/// Wraps a writer and buffers its output.
255
259
///
256
260
/// It can be excessively inefficient to work directly with something that
257
- /// implements `Write`. For example, every call to `write` on `TcpStream`
261
+ /// implements [ `Write`] . For example, every call to [ `write`] on [ `TcpStream`]
258
262
/// results in a system call. A `BufWriter` keeps an in-memory buffer of data
259
263
/// and writes it to an underlying writer in large, infrequent batches.
260
264
///
261
265
/// The buffer will be written out when the writer is dropped.
262
266
///
263
267
/// # Examples
264
268
///
265
- /// Let's write the numbers one through ten to a `TcpStream`:
269
+ /// Let's write the numbers one through ten to a [ `TcpStream`] :
266
270
///
267
271
/// ```no_run
268
272
/// use std::io::prelude::*;
@@ -294,6 +298,10 @@ impl<R: Seek> Seek for BufReader<R> {
294
298
/// By wrapping the stream with a `BufWriter`, these ten writes are all grouped
295
299
/// together by the buffer, and will all be written out in one system call when
296
300
/// the `stream` is dropped.
301
+ ///
302
+ /// [`Write`]: ../../std/io/trait.Write.html
303
+ /// [`write`]: ../../std/net/struct.TcpStream.html#method.write
304
+ /// [`TcpStream`]: ../../std/net/struct.TcpStream.html
297
305
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
298
306
pub struct BufWriter < W : Write > {
299
307
inner : Option < W > ,
0 commit comments