File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ members = ["examples/*"]
2222[dependencies ]
2323bytes = " 1.4"
2424indexmap = " 2"
25- rand = { version = " 0.8.5 " , features = [" small_rng" ] }
26- rand_distr = " 0.4.3 "
25+ rand = { version = " 0.9 " , features = [" small_rng" ] }
26+ rand_distr = " 0.5 "
2727regex = { version = " 1" , optional = true }
2828scoped-tls = " 1.0.1"
2929tokio = { version = " 1.25.0" , features = [" full" , " test-util" ] }
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ impl Builder {
182182 ///
183183 /// This will use default rng with entropy from the device running.
184184 pub fn build < ' a > ( & self ) -> Sim < ' a > {
185- self . build_with_rng ( Box :: new ( rand:: rngs:: SmallRng :: from_entropy ( ) ) )
185+ self . build_with_rng ( Box :: new ( rand:: rngs:: SmallRng :: from_os_rng ( ) ) )
186186 }
187187
188188 /// Build a sim with a provided `rng`.
Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ mod test {
783783 } )
784784 } ;
785785
786- let construct_a_first = sim. world . borrow_mut ( ) . rng . gen_bool ( 0.5 ) ;
786+ let construct_a_first = sim. world . borrow_mut ( ) . rng . random_bool ( 0.5 ) ;
787787 if construct_a_first {
788788 make_a ( & mut sim) ;
789789 make_b ( & mut sim) ;
Original file line number Diff line number Diff line change @@ -507,13 +507,13 @@ impl Link {
507507 fn rand_partition ( & self , global : & config:: MessageLoss , rand : & mut dyn RngCore ) -> bool {
508508 let config = self . config . message_loss . as_ref ( ) . unwrap_or ( global) ;
509509 let fail_rate = config. fail_rate ;
510- fail_rate > 0.0 && rand. gen_bool ( fail_rate)
510+ fail_rate > 0.0 && rand. random_bool ( fail_rate)
511511 }
512512
513513 fn rand_repair ( & self , global : & config:: MessageLoss , rand : & mut dyn RngCore ) -> bool {
514514 let config = self . config . message_loss . as_ref ( ) . unwrap_or ( global) ;
515515 let repair_rate = config. repair_rate ;
516- repair_rate > 0.0 && rand. gen_bool ( repair_rate)
516+ repair_rate > 0.0 && rand. random_bool ( repair_rate)
517517 }
518518
519519 fn delay ( & self , global : & config:: Latency , rand : & mut dyn RngCore ) -> Duration {
You can’t perform that action at this time.
0 commit comments