Skip to content

Commit e5b86e2

Browse files
hkBstibraheemdev
andauthored
Apply suggestions from code review
Co-authored-by: Ibraheem Ahmed <[email protected]>
1 parent 51c5700 commit e5b86e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

library/std/src/io/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -2250,18 +2250,18 @@ fn skip_until<R: BufRead + ?Sized>(r: &mut R, delim: u8) -> Result<usize> {
22502250
/// ```
22512251
#[stable(feature = "rust1", since = "1.0.0")]
22522252
pub trait BufRead: Read {
2253-
/// Returns the contents of the internal buffer, filling it with more data, via Read methods, if empty.
2253+
/// Returns the contents of the internal buffer, filling it with more data, via `Read` methods, if empty.
22542254
///
22552255
/// This is a lower-level method and is meant to be used together with [`consume`],
22562256
/// which can be used to mark bytes that should not be returned by subsequent calls to `read`.
22572257
///
22582258
/// [`consume`]: BufRead::consume
22592259
///
2260-
/// Returns an empty buffer to indicate that the stream has reached EOF.
2260+
/// Returns an empty buffer when the stream has reached EOF.
22612261
///
22622262
/// # Errors
22632263
///
2264-
/// Passes on I/O errors from Read.
2264+
/// This function will return an I/O error if a `Read` method was called, but returned an error.
22652265
///
22662266
/// # Examples
22672267
///
@@ -2288,12 +2288,12 @@ pub trait BufRead: Read {
22882288
fn fill_buf(&mut self) -> Result<&[u8]>;
22892289

22902290
/// Marks the given `amount` of additional bytes from the internal buffer as having been read.
2291-
/// Subsequent calls to `read` return bytes that have not yet been so marked.
2291+
/// Subsequent calls to `read` only return bytes that have not been marked as read.
22922292
///
22932293
/// This is a lower-level method and is meant to be used together with [`fill_buf`],
2294-
/// which can be used to fill the internal buffer via Read methods.
2294+
/// which can be used to fill the internal buffer via `Read` methods.
22952295
///
2296-
/// It is a logic error if `amount` exceeds the number of unread bytes in the internal buffer.
2296+
/// It is a logic error if `amount` exceeds the number of unread bytes in the internal buffer, which is returned by [`fill_buf`].
22972297
///
22982298
/// # Examples
22992299
///
@@ -2315,7 +2315,7 @@ pub trait BufRead: Read {
23152315
///
23162316
/// # Errors
23172317
///
2318-
/// Passes on I/O errors from Read.
2318+
/// This function will return an I/O error if a `Read` method was called, but returned an error.
23192319
///
23202320
/// Examples
23212321
///

0 commit comments

Comments
 (0)