File tree Expand file tree Collapse file tree 4 files changed +67
-45
lines changed
Expand file tree Collapse file tree 4 files changed +67
-45
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ indoc = "2"
2525libc = " 0.2.42"
2626memmem = " 0.1.1"
2727num_enum = " 0.7"
28- rand = " 0.8 "
28+ rand = " 0.9 "
2929regex-automata = { version = " 0.4.9" }
3030serde = { version = " 1.0.113" , features = [ " derive" ] }
3131serde_json = " 1.0.56"
Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ impl Expr for ComparisonExpr {
492492
493493 #[ cfg( any( target_arch = "x86" , target_arch = "x86_64" ) ) ]
494494 if * USE_AVX2 {
495- use rand:: { Rng , thread_rng } ;
495+ use rand:: { Rng , rng } ;
496496 use sliceslice:: x86:: * ;
497497
498498 fn slice_to_array < const N : usize > ( slice : & [ u8 ] ) -> [ u8 ; N ] {
@@ -501,7 +501,7 @@ impl Expr for ComparisonExpr {
501501 array
502502 }
503503
504- let position = thread_rng ( ) . gen_range ( 1 ..bytes. len ( ) ) ;
504+ let position = rng ( ) . random_range ( 1 ..bytes. len ( ) ) ;
505505 return unsafe {
506506 match bytes. len ( ) {
507507 2 => search ! ( Avx2Searcher :: with_position(
@@ -570,10 +570,10 @@ impl Expr for ComparisonExpr {
570570 }
571571 #[ cfg( target_arch = "wasm32" ) ]
572572 if * USE_SIMD128 {
573- use rand:: { Rng , thread_rng } ;
573+ use rand:: { Rng , rng } ;
574574 use sliceslice:: wasm32:: * ;
575575
576- let position = thread_rng ( ) . gen_range ( 1 ..bytes. len ( ) ) ;
576+ let position = rng ( ) . random_range ( 1 ..bytes. len ( ) ) ;
577577
578578 return unsafe { search ! ( Wasm32Searcher :: with_position( bytes, position) ) } ;
579579 }
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ crate-type = ["cdylib"]
1212doctest = false
1313
1414[dependencies ]
15- getrandom = { version = " 0.2 " , features = [" js " ] }
16- js-sys = " 0.3.41 "
15+ getrandom = { version = " 0.3 " , features = [" wasm_js " ] }
16+ js-sys = " 0.3.77 "
1717serde-wasm-bindgen = " 0.5.0"
1818wasm-bindgen = { version = " 0.2" , features = [" serde-serialize" ] }
1919wirefilter.workspace = true
You can’t perform that action at this time.
0 commit comments