doc: clarify that consume can be called after BufReader::peek

This commit is contained in:
binarycat 2025-03-02 09:49:43 -06:00
parent 617aad8c2e
commit 57046e1470

View file

@ -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