diff options
| author | Sean Linsley <code@seanlinsley.com> | 2023-10-16 12:41:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-16 12:41:43 -0500 |
| commit | 1fb00335df72fc3a05cd13a2bd5013f362d21177 (patch) | |
| tree | 8432db5f6744cc5a94945c249a02556208af8993 | |
| parent | 98c1e3d95ba7f5d29915dac3f391a296648aa74c (diff) | |
| download | rust-1fb00335df72fc3a05cd13a2bd5013f362d21177.tar.gz rust-1fb00335df72fc3a05cd13a2bd5013f362d21177.zip | |
Improve rewind documentation
| -rw-r--r-- | library/std/src/io/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index c0a72948112..b7b6a9a24c9 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -556,6 +556,10 @@ where /// therefore, using something that implements [`BufRead`], such as /// [`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 /// /// [`File`]s implement `Read`: |
