Skip to content

Commit 4f5c5ec

Browse files
committed
limiter: fix doc test failure when all features are turned off
Signed-off-by: kennytm <[email protected]>
1 parent 385aeb4 commit 4f5c5ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/limiter.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ impl<I: Copy + Sub<Output = Duration>> Bucket<I> {
7979
///
8080
/// # Examples
8181
///
82-
/// ```rust
82+
#[cfg_attr(feature = "standard-clock", doc = "```rust")]
83+
#[cfg_attr(not(feature = "standard-clock"), doc = "```ignore")]
8384
/// use async_speed_limit::Limiter;
8485
/// use std::time::Duration;
8586
///
@@ -175,7 +176,8 @@ macro_rules! declare_limiter {
175176
/// Upload some small files atomically in parallel, while maintaining a
176177
/// global speed limit of 1 MiB/s.
177178
///
178-
/// ```rust
179+
#[cfg_attr(feature = "standard-clock", doc = "```rust")]
180+
#[cfg_attr(not(feature = "standard-clock"), doc = "```ignore")]
179181
/// use async_speed_limit::Limiter;
180182
/// use futures_util::future::try_join_all;
181183
///

0 commit comments

Comments
 (0)