File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ lru = "0.14.0"
24
24
mysql_common = { version = " 0.35" , default-features = false }
25
25
pem = " 3.0"
26
26
percent-encoding = " 2.1.0"
27
- rand = " 0.8.5 "
27
+ rand = " 0.9 "
28
28
serde = " 1"
29
29
serde_json = " 1"
30
30
socket2 = " 0.5.2"
Original file line number Diff line number Diff line change @@ -1310,7 +1310,7 @@ mod test {
1310
1310
use bytes:: Bytes ;
1311
1311
use futures_util:: stream:: { self , StreamExt } ;
1312
1312
use mysql_common:: constants:: MAX_PAYLOAD_LEN ;
1313
- use rand:: Fill ;
1313
+ use rand:: Rng ;
1314
1314
use tokio:: { io:: AsyncWriteExt , net:: TcpListener } ;
1315
1315
1316
1316
use crate :: {
@@ -1645,9 +1645,8 @@ mod test {
1645
1645
] ;
1646
1646
1647
1647
fn random_pass ( ) -> String {
1648
- let mut rng = rand:: thread_rng ( ) ;
1649
- let mut pass = [ 0u8 ; 10 ] ;
1650
- pass. try_fill ( & mut rng) . unwrap ( ) ;
1648
+ let mut rng = rand:: rng ( ) ;
1649
+ let pass: [ u8 ; 10 ] = rng. gen ( ) ;
1651
1650
1652
1651
IntoIterator :: into_iter ( pass)
1653
1652
. map ( |x| ( ( x % ( 123 - 97 ) ) + 97 ) as char )
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ impl PoolOpts {
451
451
pub ( crate ) fn new_connection_ttl_deadline ( & self ) -> Option < Instant > {
452
452
if let Some ( ttl) = self . abs_conn_ttl {
453
453
let jitter = if let Some ( jitter) = self . abs_conn_ttl_jitter {
454
- Duration :: from_secs ( rand:: thread_rng ( ) . gen_range ( 0 ..=jitter. as_secs ( ) ) )
454
+ Duration :: from_secs ( rand:: rng ( ) . random_range ( 0 ..=jitter. as_secs ( ) ) )
455
455
} else {
456
456
Duration :: ZERO
457
457
} ;
You can’t perform that action at this time.
0 commit comments