tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
26.59k stars 2.45k forks source link

io: implement `AsyncSeek` for `Empty` #6663

Closed zaeleus closed 3 months ago

zaeleus commented 3 months ago

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.