Skip to content

Commit

Permalink
upgrade rand to 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
CrockAgile committed Jan 29, 2025
1 parent ce60ac2 commit bdb8588
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tracing-flame = { version = "0.2.0", optional = true }
hashbrown = "0.15.0"

[dependencies.rand]
version = "0.8.0"
version = "0.9"

[dependencies.nom]
version = "^7.0.0"
Expand Down Expand Up @@ -90,4 +90,4 @@ name = "divan"
harness = false

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2.5", features = ["js"] } # needed for rand
getrandom = { version = "0.3", features = ["wasm_js"] } # needed for rand
4 changes: 2 additions & 2 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::production::Production;
use crate::term::Term;
#[cfg(feature = "ABNF")]
use crate::ABNF;
use rand::{rngs::StdRng, seq::SliceRandom, thread_rng, Rng, SeedableRng};
use rand::{rng, rngs::StdRng, seq::IndexedRandom, Rng, SeedableRng};

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -428,7 +428,7 @@ impl Grammar {
pub fn generate_callback(&self, f: impl Fn(&str, &str) -> bool) -> Result<String, Error> {
// let seed: &[_] = &[1, 2, 3, 4];
let mut seed: [u8; 32] = [0; 32];
thread_rng().fill(&mut seed);
rng().fill(&mut seed);
let mut rng: StdRng = SeedableRng::from_seed(seed);
self.generate_seeded_callback(&mut rng, f)
}
Expand Down

0 comments on commit bdb8588

Please sign in to comment.