This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -373,13 +373,14 @@ pub fn unix_signal_stream_with_priority(
373
373
#[ cfg( test) ]
374
374
mod tests {
375
375
use super :: * ;
376
+ use std:: time:: Duration ;
376
377
use std:: thread;
377
378
378
379
#[ test]
379
380
fn test_timeout ( ) {
380
381
let c = MainContext :: new ( ) ;
381
382
382
- c. block_on ( timeout_future ( 20 ) ) ;
383
+ c. block_on ( timeout_future ( Duration :: from_millis ( 20 ) ) ) ;
383
384
}
384
385
385
386
#[ test]
@@ -388,7 +389,7 @@ mod tests {
388
389
let l = :: MainLoop :: new ( Some ( & c) , false ) ;
389
390
390
391
let l_clone = l. clone ( ) ;
391
- c. spawn ( timeout_future ( 20 ) . then ( move |( ) | {
392
+ c. spawn ( timeout_future ( Duration :: from_millis ( 20 ) ) . then ( move |( ) | {
392
393
l_clone. quit ( ) ;
393
394
futures_util:: future:: ready ( ( ) )
394
395
} ) ) ;
@@ -405,7 +406,7 @@ mod tests {
405
406
{
406
407
let count = & mut count;
407
408
c. block_on (
408
- interval_stream ( 20 )
409
+ interval_stream ( Duration :: from_millis ( 20 ) )
409
410
. take ( 2 )
410
411
. for_each ( |( ) | {
411
412
* count += 1 ;
@@ -423,7 +424,7 @@ mod tests {
423
424
fn test_timeout_and_channel ( ) {
424
425
let c = MainContext :: default ( ) ;
425
426
426
- let res = c. block_on ( timeout_future ( 20 ) . then ( |( ) | {
427
+ let res = c. block_on ( timeout_future ( Duration :: from_millis ( 20 ) ) . then ( |( ) | {
427
428
let ( sender, receiver) = oneshot:: channel ( ) ;
428
429
429
430
thread:: spawn ( move || {
You can’t perform that action at this time.
0 commit comments