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: implement AsyncSeek for Empty #6663

Merged
merged 4 commits into from
Jul 1, 2024
Merged

Conversation

zaeleus
Copy link
Contributor

@zaeleus zaeleus commented Jun 27, 2024

Motivation

While porting a test from std:io to tokio::io, I discovered AsyncSeek is not implemented for tokio::io::Empty. This was unexpected, as std::io::Seek was implemented for std::io::Empty in Rust 1.51.0 (2021-03-25).

Solution

This implementation mimics the behavior of the Seek implementation for std::io::Empty.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io labels Jun 28, 2024
@wathenjiang wathenjiang self-requested a review June 28, 2024 07:39
This adds more tests seeking with other kinds of `SeekFrom`. It follows
the same structure as used in
rust-lang/rust@f1cd179.

See <tokio-rs#6663 (comment)>.
This follows the style of the other trait implementations of `Empty`.

See <tokio-rs#6663 (comment)>.
Copy link
Contributor

@wathenjiang wathenjiang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@wathenjiang wathenjiang merged commit dff4ecd into tokio-rs:master Jul 1, 2024
77 checks passed
This was referenced Jul 22, 2024
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