Skip to content

Commit b42bcbc

Browse files
committed
Remove tokio & async-std features
We only use tokio now
1 parent 755de96 commit b42bcbc

4 files changed

Lines changed: 22 additions & 58 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,8 @@ jobs:
3232
components: rustfmt
3333
- name: Run tests
3434
run: |
35-
cargo check --no-default-features --features tokio
36-
cargo check --no-default-features --features tokio,sparse
37-
cargo check --no-default-features --features async-std
38-
cargo check --no-default-features --features async-std,sparse
39-
cargo test --no-default-features --features tokio
40-
cargo test --no-default-features --features tokio,sparse
41-
cargo test --no-default-features --features async-std
42-
cargo test --no-default-features --features async-std,sparse
35+
cargo check --no-default-features
36+
cargo check --no-default-features --features sparse
4337
4438
test-windows:
4539
runs-on: windows-latest
@@ -51,14 +45,8 @@ jobs:
5145
components: rustfmt
5246
- name: Run tests
5347
run: |
54-
cargo check --no-default-features --features tokio
55-
cargo check --no-default-features --features tokio,sparse
56-
cargo check --no-default-features --features async-std
57-
cargo check --no-default-features --features async-std,sparse
58-
cargo test --no-default-features --features tokio
59-
cargo test --no-default-features --features tokio,sparse
60-
cargo test --no-default-features --features async-std
61-
cargo test --no-default-features --features async-std,sparse
48+
cargo check --no-default-features
49+
cargo check --no-default-features --features sparse
6250
6351
test-macos:
6452
runs-on: macos-latest
@@ -70,14 +58,8 @@ jobs:
7058
components: rustfmt
7159
- name: Run tests
7260
run: |
73-
cargo check --no-default-features --features tokio
74-
cargo check --no-default-features --features tokio,sparse
75-
cargo check --no-default-features --features async-std
76-
cargo check --no-default-features --features async-std,sparse
77-
cargo test --no-default-features --features tokio
78-
cargo test --no-default-features --features tokio,sparse
79-
cargo test --no-default-features --features async-std
80-
cargo test --no-default-features --features async-std,sparse
61+
cargo check --no-default-features
62+
cargo check --no-default-features --features sparse
8163
8264
build-extra:
8365
runs-on: ubuntu-latest
@@ -87,14 +69,12 @@ jobs:
8769
- uses: dtolnay/rust-toolchain@stable
8870
- name: Build benches
8971
run: |
90-
cargo build --benches --no-default-features --features tokio
91-
cargo build --benches --no-default-features --features async-std
72+
cargo build --benches --no-default-features
73+
cargo build --benches --no-default-features --features sparse
9274
- name: Build release
9375
run: |
94-
cargo build --release --no-default-features --features tokio
95-
cargo build --release --no-default-features --features tokio,sparse
96-
cargo build --release --no-default-features --features async-std
97-
cargo build --release --no-default-features --features async-std,sparse
76+
cargo build --release --no-default-features
77+
cargo build --release --no-default-features --features sparse
9878
9979
lint:
10080
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Removed
2121

22+
* Drop all `async-std` stuff, we're only using `tokio` now. This removes both the `tokio` and `async-std` features.
2223

2324

2425
## [3.0.1] - 2024-01-09

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ criterion = { version = "0.4", features = ["async_tokio"] }
2828
tokio-test = "0.4"
2929

3030
[features]
31-
default = ["sparse", "tokio"]
31+
default = ["sparse"]
3232
sparse = ["libc"]
3333

3434
[[bench]]

src/lib.rs

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
//!
1818
//! **NB**: If this is on, `unsafe` code is used to make direct platform-specific calls!
1919
//!
20-
//! ### `async-std` (default)
21-
//!
22-
//! Use the async-std runtime, on by default. Either this or `tokio` is mandatory.
23-
//!
24-
//! ### `tokio`
25-
//!
26-
//! Use the tokio runtime. Either this or `async_std` is mandatory.
27-
//!
2820
//! ## Examples
2921
//!
3022
//! Reading, writing, deleting and truncating:
@@ -91,9 +83,6 @@
9183
//! }
9284
//! # }
9385
94-
#[cfg(not(feature = "tokio"))]
95-
compile_error!("feature `random-access-disk/tokio` must be enabled.");
96-
9786
use async_lock::Mutex;
9887
use random_access_storage::{BoxFuture, RandomAccess, RandomAccessError};
9988
use std::{
@@ -109,24 +98,18 @@ use tokio::{
10998
io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt},
11099
};
111100

112-
#[cfg(all(
113-
feature = "sparse",
114-
any(
115-
target_os = "linux",
116-
target_os = "android",
117-
target_os = "freebsd",
118-
target_os = "macos",
119-
)
101+
#[cfg(any(
102+
target_os = "linux",
103+
target_os = "android",
104+
target_os = "freebsd",
105+
target_os = "macos",
120106
))]
121107
mod unix;
122-
#[cfg(all(
123-
feature = "sparse",
124-
any(
125-
target_os = "linux",
126-
target_os = "android",
127-
target_os = "freebsd",
128-
target_os = "macos",
129-
)
108+
#[cfg(any(
109+
target_os = "linux",
110+
target_os = "android",
111+
target_os = "freebsd",
112+
target_os = "macos",
130113
))]
131114
use unix::{get_length_and_block_size, set_sparse, trim};
132115

0 commit comments

Comments
 (0)