Improve rewind documentation

This commit is contained in:
Sean Linsley 2023-10-16 12:41:43 -05:00 committed by GitHub
parent 98c1e3d95b
commit 1fb00335df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -556,6 +556,10 @@ where
/// therefore, using something that implements [`BufRead`], such as /// therefore, using something that implements [`BufRead`], such as
/// [`BufReader`], will be more efficient. /// [`BufReader`], will be more efficient.
/// ///
/// Repeated calls to the reader use the same cursor, so for example
/// calling `read_to_end` twice on a [`File`] will only return the file's
/// contents once. It's recommended to first call `rewind()` in that case.
///
/// # Examples /// # Examples
/// ///
/// [`File`]s implement `Read`: /// [`File`]s implement `Read`: