Skip to content

Commit

Permalink
Remove async-std default runtime support
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Oct 15, 2024
1 parent 35b6377 commit 1eccf7c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ log = "^0.4"
minreq = { version = "2.11.0", features = ["json-using-serde"], optional = true }
reqwest = { version = "0.12", features = ["json"], default-features = false, optional = true }

# async runtime
async-std = { version = "1.13", optional = true }
# default async runtime
tokio = { version = "1.40", features = ["time"], optional = true }

[dev-dependencies]
Expand All @@ -43,8 +42,6 @@ blocking-https-native = ["blocking", "minreq/https-native"]
blocking-https-bundled = ["blocking", "minreq/https-bundled"]

tokio = ["dep:tokio", "async"]
async-std = ["dep:async-std", "async"]

async = ["reqwest", "reqwest/socks"]
async-https = ["async", "reqwest/default-tls"]
async-https-native = ["async", "reqwest/native-tls"]
Expand Down
8 changes: 0 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,6 @@ mod test {
assert!(client.is_ok());
}

#[cfg(feature = "async-std")]
#[test]
fn use_async_std_runtime() {
let builder = Builder::new("https://blockstream.info/testnet/api");
let client = builder.build_async();
assert!(client.is_ok());
}

#[cfg(not(feature = "tokio"))]
struct TestRuntime;

Expand Down
7 changes: 0 additions & 7 deletions src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,3 @@ impl Runtime for DefaultRuntime {
tokio::time::sleep(duration).await;
}
}

#[cfg(feature = "async-std")]
impl Runtime for DefaultRuntime {
async fn sleep(duration: Duration) {
async_std::task::sleep(duration).await;
}
}

0 comments on commit 1eccf7c

Please sign in to comment.