Skip to content

Commit 67aaddd

Browse files
author
Jonathan Turner
authored
Rollup merge of #37115 - GuillaumeGomez:buf_reader_urls, r=kmcallister
add missing urls for BufWriter and BufReader r? @steveklabnik
2 parents 3da9ddb + 96a8bae commit 67aaddd

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/libstd/io/buffered.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ use memchr;
2020

2121
/// The `BufReader` struct adds buffering to any reader.
2222
///
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`]
2626
/// and maintains an in-memory buffer of the results.
2727
///
28+
/// [`Read`]: ../../std/io/trait.Read.html
29+
/// [`read`]: ../../std/net/struct.TcpStream.html#method.read
30+
/// [`TcpStream`]: ../../std/net/struct.TcpStream.html
31+
///
2832
/// # Examples
2933
///
3034
/// ```
@@ -254,15 +258,15 @@ impl<R: Seek> Seek for BufReader<R> {
254258
/// Wraps a writer and buffers its output.
255259
///
256260
/// 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`]
258262
/// results in a system call. A `BufWriter` keeps an in-memory buffer of data
259263
/// and writes it to an underlying writer in large, infrequent batches.
260264
///
261265
/// The buffer will be written out when the writer is dropped.
262266
///
263267
/// # Examples
264268
///
265-
/// Let's write the numbers one through ten to a `TcpStream`:
269+
/// Let's write the numbers one through ten to a [`TcpStream`]:
266270
///
267271
/// ```no_run
268272
/// use std::io::prelude::*;
@@ -294,6 +298,10 @@ impl<R: Seek> Seek for BufReader<R> {
294298
/// By wrapping the stream with a `BufWriter`, these ten writes are all grouped
295299
/// together by the buffer, and will all be written out in one system call when
296300
/// 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
297305
#[stable(feature = "rust1", since = "1.0.0")]
298306
pub struct BufWriter<W: Write> {
299307
inner: Option<W>,

0 commit comments

Comments
 (0)