Skip to content

Commit d248d90

Browse files
committed
Fix tests without default features
1 parent 06159c4 commit d248d90

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ pub mod api;
7777
pub mod r#async;
7878
#[cfg(feature = "blocking")]
7979
pub mod blocking;
80-
#[cfg(feature = "async")]
8180
pub mod sleeper;
8281

8382
pub use api::*;
@@ -1014,25 +1013,25 @@ mod test {
10141013
assert_eq!(tx, tx_async);
10151014
}
10161015

1017-
#[cfg(feature = "tokio")]
1016+
#[cfg(all(feature = "async", feature = "tokio"))]
10181017
#[test]
10191018
fn use_builder_with_tokio_as_normal() {
10201019
let builder = Builder::new("https://blockstream.info/testnet/api");
10211020
let client = builder.build_async();
10221021
assert!(client.is_ok());
10231022
}
10241023

1025-
#[cfg(not(feature = "tokio"))]
1024+
#[cfg(all(feature = "async", not(feature = "tokio")))]
10261025
struct TestRuntime;
10271026

1028-
#[cfg(not(feature = "tokio"))]
1027+
#[cfg(all(feature = "async", not(feature = "tokio")))]
10291028
impl Sleeper for TestRuntime {
10301029
async fn sleep(duration: Duration) {
10311030
tokio::time::sleep(duration).await;
10321031
}
10331032
}
10341033

1035-
#[cfg(not(feature = "tokio"))]
1034+
#[cfg(all(feature = "async", not(feature = "tokio")))]
10361035
#[test]
10371036
fn use_with_custom_runtime() {
10381037
let builder =

0 commit comments

Comments
 (0)