diff options
Diffstat (limited to 'tests/time_throttle.rs')
-rw-r--r-- | tests/time_throttle.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/time_throttle.rs b/tests/time_throttle.rs index 7102d17..c886319 100644 --- a/tests/time_throttle.rs +++ b/tests/time_throttle.rs @@ -1,7 +1,8 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] -use tokio::time::{self, throttle}; +use tokio::stream::StreamExt; +use tokio::time; use tokio_test::*; use std::time::Duration; @@ -10,10 +11,7 @@ use std::time::Duration; async fn usage() { time::pause(); - let mut stream = task::spawn(throttle( - Duration::from_millis(100), - futures::stream::repeat(()), - )); + let mut stream = task::spawn(futures::stream::repeat(()).throttle(Duration::from_millis(100))); assert_ready!(stream.poll_next()); assert_pending!(stream.poll_next()); |