Skip to content

Commit b538801

Browse files
committed
Add feature gates in doc tests
1 parent 5ccb504 commit b538801

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@
1414
//! You can create a blocking client as follows:
1515
//!
1616
//! ```no_run
17+
//! # #[cfg(feature = "blocking")]
18+
//! # {
1719
//! use esplora_client::Builder;
1820
//! let builder = Builder::new("https://blockstream.info/testnet/api");
1921
//! let blocking_client = builder.build_blocking();
2022
//! # Ok::<(), esplora_client::Error>(());
23+
//! # }
2124
//! ```
2225
//!
2326
//! Here is an example of how to create an asynchronous client.
2427
//!
2528
//! ```no_run
29+
//! # #[cfg(any(feature = "async", feature = "async-https"))]
30+
//! # {
2631
//! use esplora_client::Builder;
2732
//! let builder = Builder::new("https://blockstream.info/testnet/api");
2833
//! let async_client = builder.build_async();
2934
//! # Ok::<(), esplora_client::Error>(());
35+
//! # }
3036
//! ```
3137
//!
3238
//! ## Features

0 commit comments

Comments
 (0)