Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rewind documentation #116807

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Improve rewind documentation #116807

merged 1 commit into from
Nov 24, 2023

Conversation

seanlinsley
Copy link
Contributor

@seanlinsley seanlinsley commented Oct 16, 2023

The persistent use of an internal cursor for readers is expected for buffer data types that aren't read all at once, but for files it leads to the confusing situation where calling read_to_end on the same file handle multiple times only returns the contents of the file for the first call. This PR adds a note to the documentation clarifying that in that case, rewind() must first be called.

I'm unsure if this is the right location for the docs update. Maybe it should also be duplicated on File?

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 16, 2023
@thomcc
Copy link
Member

thomcc commented Nov 24, 2023

This is probably fine. I'm not sure it's needed but I don;'t think it hurts.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 24, 2023

📌 Commit 1fb0033 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#116807 (Improve rewind documentation)
 - rust-lang#117656 (Update windows-bindgen and define `INVALID_HANDLE_VALUE` ourselves)
 - rust-lang#117940 (chore: remove unnecessary drop)
 - rust-lang#118028 (Document behavior of `<dyn Any as Any>::type_id()`)
 - rust-lang#118060 (Use an absolute path to the NUL device)
 - rust-lang#118224 (Sort unstable items last in rustdoc, instead of first)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b865709 into rust-lang:master Nov 24, 2023
@rustbot rustbot added this to the 1.76.0 milestone Nov 24, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2023
Rollup merge of rust-lang#116807 - seanlinsley:patch-2, r=thomcc

Improve rewind documentation

The persistent use of an internal cursor for readers is expected for buffer data types that aren't read all at once, but for files it leads to the confusing situation where calling `read_to_end` on the same file handle multiple times only returns the contents of the file for the first call. This PR adds a note to the documentation clarifying that in that case, `rewind()` must first be called.

I'm unsure if this is the right location for the docs update. Maybe it should also be duplicated on `File`?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants