Skip to content

Commit 218f75c

Browse files
committed
Document macro
1 parent bae7b37 commit 218f75c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/limiter/rejection_delay.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ mod tests {
7474

7575
let _token = limiter.try_acquire().await.unwrap();
7676

77-
let now = Instant::now();
77+
let before_acquire = Instant::now();
7878
let token = limiter.try_acquire().await;
7979

8080
assert!(token.is_none());
81-
assert_elapsed!(now, delay, Duration::from_millis(10));
81+
assert_elapsed!(before_acquire, delay, Duration::from_millis(10));
8282
}
8383

8484
#[tokio::test]
@@ -89,13 +89,14 @@ mod tests {
8989

9090
let _token = limiter.try_acquire().await.unwrap();
9191

92-
let now = Instant::now();
92+
let before_acquire = Instant::now();
9393
let token = limiter.acquire_timeout(Duration::ZERO).await;
9494

9595
assert!(token.is_none());
96-
assert_elapsed!(now, delay, Duration::from_millis(10));
96+
assert_elapsed!(before_acquire, delay, Duration::from_millis(10));
9797
}
9898

99+
/// Assert that a given duration has elapsed since `start`, within the given tolerance.
99100
#[macro_export]
100101
#[cfg(test)]
101102
macro_rules! assert_elapsed {

0 commit comments

Comments
 (0)