@@ -4,9 +4,6 @@ use crate::*;
4
4
use spin1:: Mutex as Spinlock ;
5
5
use std:: { any:: Any , marker:: PhantomData } ;
6
6
7
- #[ cfg( feature = "eventual-fairness" ) ]
8
- use nanorand:: Rng ;
9
-
10
7
// A unique token corresponding to an event in a selector
11
8
type Token = usize ;
12
9
@@ -81,7 +78,7 @@ pub struct Selector<'a, T: 'a> {
81
78
next_poll : usize ,
82
79
signalled : Arc < Spinlock < VecDeque < Token > > > ,
83
80
#[ cfg( feature = "eventual-fairness" ) ]
84
- rng : nanorand :: WyRand ,
81
+ rng : fastrand :: Rng ,
85
82
phantom : PhantomData < * const ( ) > ,
86
83
}
87
84
@@ -106,7 +103,7 @@ impl<'a, T> Selector<'a, T> {
106
103
signalled : Arc :: default ( ) ,
107
104
phantom : PhantomData :: default ( ) ,
108
105
#[ cfg( feature = "eventual-fairness" ) ]
109
- rng : nanorand :: WyRand :: new ( ) ,
106
+ rng : fastrand :: Rng :: new ( ) ,
110
107
}
111
108
}
112
109
@@ -320,7 +317,7 @@ impl<'a, T> Selector<'a, T> {
320
317
fn wait_inner ( mut self , deadline : Option < Instant > ) -> Option < T > {
321
318
#[ cfg( feature = "eventual-fairness" ) ]
322
319
{
323
- self . next_poll = self . rng . generate_range ( 0 ..self . selections . len ( ) ) ;
320
+ self . next_poll = self . rng . usize ( 0 ..self . selections . len ( ) ) ;
324
321
}
325
322
326
323
let res = ' outer: loop {
0 commit comments