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