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

io: Add convenience method AsyncSeekExt::rewind. #4107

Merged
merged 3 commits into from
Sep 14, 2021
Merged

io: Add convenience method AsyncSeekExt::rewind. #4107

merged 3 commits into from
Sep 14, 2021

Conversation

tvercruyssen
Copy link
Contributor

Motivation

Since version 1.55 has the Rust std library implemented a convenience function called rewind that is part of the io::Seek trait. I have found this to be a very helpful function in making my code more readable/simpler.

Solution

Implement the rewind function as part of the AsyncSeekExt trait.

[Disclaimer]

The test might not be in the proper place apologies for that. I didn't know of a better place to put it.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io labels Sep 13, 2021
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

@Darksonn Darksonn merged commit 7af0f32 into tokio-rs:master Sep 14, 2021
@tvercruyssen tvercruyssen deleted the async_seek_ext_rewind branch September 14, 2021 17:49
@Darksonn Darksonn mentioned this pull request Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants