Skip to content

Commit df73abe

Browse files
committed
std: small doc fixes for BufReader and BufWriter
* fix probable copy-paste error in BufWriter.get_mut() * more consistent punctuation
1 parent f9f5809 commit df73abe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libstd/io/buffered.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use io::{self, DEFAULT_BUF_SIZE, Error, ErrorKind, SeekFrom};
2121
use ptr;
2222
use iter;
2323

24-
/// Wraps a `Read` and buffers input from it
24+
/// Wraps a `Read` and buffers input from it.
2525
///
2626
/// It can be excessively inefficient to work directly with a `Read` instance.
2727
/// For example, every call to `read` on `TcpStream` results in a system call.
@@ -54,13 +54,13 @@ pub struct BufReader<R> {
5454
}
5555

5656
impl<R: Read> BufReader<R> {
57-
/// Creates a new `BufReader` with a default buffer capacity
57+
/// Creates a new `BufReader` with a default buffer capacity.
5858
#[stable(feature = "rust1", since = "1.0.0")]
5959
pub fn new(inner: R) -> BufReader<R> {
6060
BufReader::with_capacity(DEFAULT_BUF_SIZE, inner)
6161
}
6262

63-
/// Creates a new `BufReader` with the specified buffer capacity
63+
/// Creates a new `BufReader` with the specified buffer capacity.
6464
#[stable(feature = "rust1", since = "1.0.0")]
6565
pub fn with_capacity(cap: usize, inner: R) -> BufReader<R> {
6666
let mut buf = Vec::with_capacity(cap);
@@ -183,7 +183,7 @@ impl<R: Seek> Seek for BufReader<R> {
183183
}
184184
}
185185

186-
/// Wraps a Writer and buffers output to it
186+
/// Wraps a Writer and buffers output to it.
187187
///
188188
/// It can be excessively inefficient to work directly with a `Write`. For
189189
/// example, every call to `write` on `TcpStream` results in a system call. A
@@ -205,13 +205,13 @@ pub struct BufWriter<W: Write> {
205205
pub struct IntoInnerError<W>(W, Error);
206206

207207
impl<W: Write> BufWriter<W> {
208-
/// Creates a new `BufWriter` with a default buffer capacity
208+
/// Creates a new `BufWriter` with a default buffer capacity.
209209
#[stable(feature = "rust1", since = "1.0.0")]
210210
pub fn new(inner: W) -> BufWriter<W> {
211211
BufWriter::with_capacity(DEFAULT_BUF_SIZE, inner)
212212
}
213213

214-
/// Creates a new `BufWriter` with the specified buffer capacity
214+
/// Creates a new `BufWriter` with the specified buffer capacity.
215215
#[stable(feature = "rust1", since = "1.0.0")]
216216
pub fn with_capacity(cap: usize, inner: W) -> BufWriter<W> {
217217
BufWriter {
@@ -253,11 +253,11 @@ impl<W: Write> BufWriter<W> {
253253
#[stable(feature = "rust1", since = "1.0.0")]
254254
pub fn get_ref(&self) -> &W { self.inner.as_ref().unwrap() }
255255

256-
/// Gets a mutable reference to the underlying write.
256+
/// Gets a mutable reference to the underlying writer.
257257
///
258258
/// # Warning
259259
///
260-
/// It is inadvisable to directly read from the underlying writer.
260+
/// It is inadvisable to directly write to the underlying writer.
261261
#[stable(feature = "rust1", since = "1.0.0")]
262262
pub fn get_mut(&mut self) -> &mut W { self.inner.as_mut().unwrap() }
263263

0 commit comments

Comments
 (0)