File tree 1 file changed +3
-3
lines changed
linkerd/distribute/src/service 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: { keys:: KeyId , WeightedServiceKeys } ;
2
2
use ahash:: HashMap ;
3
3
use linkerd_stack:: { NewService , Service } ;
4
- use rand:: { distributions :: WeightedError , rngs:: SmallRng , SeedableRng } ;
4
+ use rand:: { rngs:: SmallRng , SeedableRng } ;
5
5
use std:: {
6
6
hash:: Hash ,
7
7
sync:: Arc ,
@@ -21,7 +21,7 @@ pub(crate) struct RandomAvailableSelection<K, S> {
21
21
}
22
22
23
23
fn new_rng ( ) -> SmallRng {
24
- SmallRng :: from_rng ( rand:: thread_rng ( ) ) . expect ( "RNG must initialize" )
24
+ SmallRng :: from_rng ( & mut rand:: rng ( ) )
25
25
}
26
26
27
27
impl < K , S > RandomAvailableSelection < K , S > {
92
92
// to `poll_ready` can try this backend again.
93
93
match selector. disable_backend ( id) {
94
94
Ok ( ( ) ) => { }
95
- Err ( WeightedError :: AllWeightsZero ) => {
95
+ Err ( rand :: distr :: weighted :: Error :: InsufficientNonZero ) => {
96
96
// There are no backends remaining.
97
97
break ;
98
98
}
You can’t perform that action at this time.
0 commit comments