Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 79 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serde = { version = "1.0.164", features = ["derive"] }
sha2 = { version = "0.10.8" }
rayon = { version = "1.8.0" }
log = { version = "0.4.20" }
rand = { version = "0.8.5" }
rand = { version = "0.9.3" }
path-absolutize = { version = "3.1.1", optional = false, features = [
"use_unix_paths_on_wasm",
] }
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/built_in_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ fn random_fn<'a>(
let start = start.parse::<i64>().unwrap();
let end = end.parse::<i64>().unwrap();
// Inclusive range
let value = state.get_rng().gen_range(start..=end);
let value = state.get_rng().random_range(start..=end);
Ok(ResolvedPattern::from_constant(Constant::Integer(value)))
}
[Some(_), None] => {
Expand All @@ -405,7 +405,7 @@ fn random_fn<'a>(
bail!("If you provide an end argument to random(), you must provide a start argument")
}
[None, None] => {
let value = state.get_rng().gen::<f64>();
let value = state.get_rng().random::<f64>();
Ok(ResolvedPattern::from_constant(Constant::Float(value)))
}
_ => bail!("random() takes 0 or 2 arguments"),
Expand Down
2 changes: 1 addition & 1 deletion crates/grit-pattern-matcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ elsa = { version = "1.9.0" }
getrandom = { version = "0.2.11", optional = true }
grit-util = { path = "../grit-util", version = "0.5.1" }
itertools = { version = "0.10.5" }
rand = { version = "0.8.5" }
rand = { version = "0.9.3" }
regex = { version = "1.7.3" }

[features]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<Q: QueryContext> PatternDefinition<Q> {
/// Create an unnamed ephemeral pattern
/// This is primarily useful for the bubble pattern, where we want to create a new scope
pub fn new_ephemeral(params: Vec<(String, Variable)>, pattern: Pattern<Q>) -> Self {
let random_name = format!("<bubble:{}>", rand::thread_rng().gen::<u32>());
let random_name = format!("<bubble:{}>", rand::rng().random::<u32>());

Self {
name: random_name,
Expand Down
2 changes: 1 addition & 1 deletion crates/gritmodule/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde = { version = "1.0.164", features = ["derive"] }
serde_yaml = { version = "0.9.25" }
anyhow = { version = "1.0.70" }
futures = { version = "0.3.29" }
rand = { version = "0.8.5" }
rand = { version = "0.9.3" }
git2 = { version = "0.19.0", default-features = false, features = [
"vendored-openssl",
"vendored-libgit2",
Expand Down
Loading