about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-03-02 09:49:43 -0600
committerbinarycat <binarycat@envs.net>2025-03-02 09:49:43 -0600
commit57046e1470385078c866cbe2e2d5bfb0c666d0fd (patch)
tree732b62ad0c0e6513b863df066c7aaae9dbe98b03
parent617aad8c2e8783f6df8e5d1f8bb1e4bcdc70aa7b (diff)
downloadrust-57046e1470385078c866cbe2e2d5bfb0c666d0fd.tar.gz
rust-57046e1470385078c866cbe2e2d5bfb0c666d0fd.zip
doc: clarify that consume can be called after BufReader::peek
-rw-r--r--library/std/src/io/buffered/bufreader.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/std/src/io/buffered/bufreader.rs b/library/std/src/io/buffered/bufreader.rs
index 8b46738ab8a..b39bc711642 100644
--- a/library/std/src/io/buffered/bufreader.rs
+++ b/library/std/src/io/buffered/bufreader.rs
@@ -109,9 +109,13 @@ impl<R: Read + ?Sized> BufReader<R> {
     ///
     /// `n` must be less than or equal to `capacity`.
     ///
-    /// the returned slice may be less than `n` bytes long if
+    /// The returned slice may be less than `n` bytes long if
     /// end of file is reached.
     ///
+    /// After calling this method, you may call [`consume`](BufRead::consume)
+    /// with a value less than or equal to `n` to advance over some or all of
+    /// the returned bytes.
+    ///
     /// ## Examples
     ///
     /// ```rust