Skip to content

Commit 57046e1

Browse files
committed
doc: clarify that consume can be called after BufReader::peek
1 parent 617aad8 commit 57046e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/std/src/io/buffered/bufreader.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,13 @@ impl<R: Read + ?Sized> BufReader<R> {
109109
///
110110
/// `n` must be less than or equal to `capacity`.
111111
///
112-
/// the returned slice may be less than `n` bytes long if
112+
/// The returned slice may be less than `n` bytes long if
113113
/// end of file is reached.
114114
///
115+
/// After calling this method, you may call [`consume`](BufRead::consume)
116+
/// with a value less than or equal to `n` to advance over some or all of
117+
/// the returned bytes.
118+
///
115119
/// ## Examples
116120
///
117121
/// ```rust

0 commit comments

Comments
 (0)