File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ path = "src/lib.rs"
2121[dev-dependencies ]
2222time = { version = " 0.3" , features = [" formatting" ] }
2323chrono = " 0.4"
24- rand = " 0.6 "
24+ rand = " 0.9 "
Original file line number Diff line number Diff line change @@ -561,7 +561,7 @@ mod test {
561561 . unwrap ( )
562562 . as_secs ( ) ;
563563 for _ in 0 ..10000 {
564- let sec = rand:: thread_rng ( ) . gen_range ( 0 , upper) ;
564+ let sec = rand:: rng ( ) . random_range ( 0 .. upper) ;
565565 let ( s, time) = from_sec ( sec) ;
566566 assert_eq ! ( parse_rfc3339( & s) . unwrap( ) , time) ;
567567 assert_eq ! ( format_rfc3339( time) . to_string( ) , s) ;
@@ -571,7 +571,7 @@ mod test {
571571 #[ test]
572572 fn random_wide_range ( ) {
573573 for _ in 0 ..100_000 {
574- let sec = rand:: thread_rng ( ) . gen_range ( 0 , max:: SECONDS ) ;
574+ let sec = rand:: rng ( ) . random_range ( 0 .. max:: SECONDS ) ;
575575 let ( s, time) = from_sec ( sec) ;
576576 assert_eq ! ( parse_rfc3339( & s) . unwrap( ) , time) ;
577577 assert_eq ! ( format_rfc3339( time) . to_string( ) , s) ;
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ mod test {
396396 #[ test]
397397 fn random_second ( ) {
398398 for _ in 0 ..10000 {
399- let sec = rand:: thread_rng ( ) . gen_range ( 0 , 253_370_764_800 ) ;
399+ let sec = rand:: rng ( ) . random_range ( 0 .. 253_370_764_800 ) ;
400400 let d = Duration :: new ( sec, 0 ) ;
401401 assert_eq ! ( d, parse_duration( & format_duration( d) . to_string( ) ) . unwrap( ) ) ;
402402 }
@@ -405,8 +405,8 @@ mod test {
405405 #[ test]
406406 fn random_any ( ) {
407407 for _ in 0 ..10000 {
408- let sec = rand:: thread_rng ( ) . gen_range ( 0 , 253_370_764_800 ) ;
409- let nanos = rand:: thread_rng ( ) . gen_range ( 0 , 1_000_000_000 ) ;
408+ let sec = rand:: rng ( ) . random_range ( 0 .. 253_370_764_800 ) ;
409+ let nanos = rand:: rng ( ) . random_range ( 0 .. 1_000_000_000 ) ;
410410 let d = Duration :: new ( sec, nanos) ;
411411 assert_eq ! ( d, parse_duration( & format_duration( d) . to_string( ) ) . unwrap( ) ) ;
412412 }
You can’t perform that action at this time.
0 commit comments