Skip to content

Commit

Permalink
Merge pull request #9 from tikv/remove-read-initializer
Browse files Browse the repository at this point in the history
*: remove read-initializer feature
  • Loading branch information
kennytm authored Aug 7, 2023
2 parents 82c25ea + 33adfaa commit 0e74acf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "async-speed-limit"
version = "0.4.0"
version = "0.4.1"
authors = ["The TiKV Project Developers"]
license = "MIT OR Apache-2.0"
edition = "2018"
Expand All @@ -13,7 +13,7 @@ all-features = true

[dependencies]
futures-timer = { version = "3.0.2", optional = true }
futures-io = { version = "0.3.1", optional = true }
futures-io = { version = "0.3.19", optional = true }
futures-core = { version = "0.3.1", optional = true }
pin-project-lite = "0.2.0"
tokio = { version = "1", optional = true }
Expand All @@ -22,7 +22,7 @@ tokio = { version = "1", optional = true }
default = ["futures-io", "fused-future", "standard-clock"]
standard-clock = ["futures-timer"]
fused-future = ["futures-core"]
read-initializer = ["futures-io/unstable", "futures-io/read-initializer"]
read-initializer = [] # This feature has been deprecated. It is only kept for downstream compatibility.

[dev-dependencies]
futures-executor = "0.3.1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ the types.
| **standard-clock** (default) | [futures-timer] | Enables the `clock::StandardClock` struct. |
| **fused-future** (default) | [futures-core] | Implements `FusedFuture` on `limiter::Consume`. |
| **futures-io** (default) | [futures-io] | Implements `AsyncRead` and `AsyncWrite` on `limiter::Resource`. |
| **read-initializer** | [futures-io] | Implements `AsyncRead::initializer`.<br>Unstable and requires nightly compiler to enable. |
| ~~**read-initializer**~~ | - | Deprecated and does nothing. This feature has been removed since `futures-io 0.3.19`. |

[futures-core]: https://crates.io/crates/futures-core
[futures-io]: https://crates.io/crates/futures-io
Expand Down
6 changes: 0 additions & 6 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ fn length_of_result_usize<B>(a: &io::Result<usize>, _: &B) -> usize {
}

impl<R: futures_io::AsyncRead, C: Clock> futures_io::AsyncRead for Resource<R, C> {
#[cfg(feature = "read-initializer")]
#[allow(unsafe_code)]
unsafe fn initializer(&self) -> io::Initializer {
self.get_ref().initializer()
}

fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
clippy::pedantic
)]
#![allow(clippy::module_name_repetitions, clippy::must_use_candidate)]
#![cfg_attr(feature = "read-initializer", feature(read_initializer))]
#![doc = include_str!("../README.md")]

pub mod clock;
Expand Down

0 comments on commit 0e74acf

Please sign in to comment.