-
Notifications
You must be signed in to change notification settings - Fork 13.3k
doc: improve docs for std::io::Seek::rewind method #105596
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
doc: improve docs for std::io::Seek::rewind method #105596
Conversation
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Relates to #85149 |
Should it really keep the line that it's equivalent to the other function call, then? |
@@ -1770,6 +1770,9 @@ pub trait Seek { | |||
/// Rewind to the beginning of a stream. | |||
/// | |||
/// This is a convenience method, equivalent to `seek(SeekFrom::Start(0))`. | |||
/// Note that unlike `seek(SeekFrom::Start(0))`, this method does not return | |||
/// the old offset and cannot replace assignements of the form: | |||
/// `let old_offset = buf.seek(SeekFrom::Start(0))?;`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seek
doesn't return the old position unless you do SeekFrom::Current(0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also the documentation of seek:
If the seek operation completed successfully, this method returns the new position from the start of the stream.
@poliorcetics any updates on this? |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
@Dylan-DPC based on your last comment did you mean to close this? It is still open |
Ye sorry, thanks :) |
No description provided.