File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ repository = "https://github.com/jimmycuadra/retry"
12
12
version = " 1.0.0"
13
13
14
14
[dependencies ]
15
- rand = " * "
15
+ rand = { version = " 0.9 " , features = [ " thread_rng " ]}
16
16
tokio = { version = " *" , features = [" time" ], optional = true }
17
17
18
18
[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ use std::time::Duration;
5
5
use std:: u64:: MAX as U64_MAX ;
6
6
7
7
use rand:: {
8
- distributions :: { Distribution , Uniform } ,
9
- random,
8
+ distr :: { Distribution , Uniform } ,
9
+ random, rng ,
10
10
rngs:: ThreadRng ,
11
- thread_rng,
12
11
} ;
13
12
14
13
/// Each retry increases the delay since the last exponentially.
@@ -172,8 +171,8 @@ impl Range {
172
171
/// Panics if the minimum is greater than or equal to the maximum.
173
172
pub fn from_millis_exclusive ( minimum : u64 , maximum : u64 ) -> Self {
174
173
Range {
175
- distribution : Uniform :: new ( minimum, maximum) ,
176
- rng : thread_rng ( ) ,
174
+ distribution : Uniform :: new ( minimum, maximum) . expect ( "Invalid Inputs" ) ,
175
+ rng : rng ( ) ,
177
176
}
178
177
}
179
178
@@ -184,8 +183,8 @@ impl Range {
184
183
/// Panics if the minimum is greater than or equal to the maximum.
185
184
pub fn from_millis_inclusive ( minimum : u64 , maximum : u64 ) -> Self {
186
185
Range {
187
- distribution : Uniform :: new_inclusive ( minimum, maximum) ,
188
- rng : thread_rng ( ) ,
186
+ distribution : Uniform :: new_inclusive ( minimum, maximum) . expect ( "Invalid Inputs" ) ,
187
+ rng : rng ( ) ,
189
188
}
190
189
}
191
190
}
You can’t perform that action at this time.
0 commit comments