Skip to content

Commit f16ce2a

Browse files
authored
Rollup merge of rust-lang#137890 - lolbinarycat:docs-bufreader-peek-consume, r=Mark-Simulacrum
doc: clarify that consume can be called after BufReader::peek tracking issue rust-lang#128405
2 parents 903b526 + 57046e1 commit f16ce2a

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)