Skip to content

Commit 8830167

Browse files
committed
Update rand, glam and encase to latest versions
1 parent 6bb7573 commit 8830167

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+213
-213
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,8 @@ tracing = { version = "0.1", default-features = false, optional = true }
546546
bevy_dylib = { path = "crates/bevy_dylib", version = "0.16.0-dev", default-features = false, optional = true }
547547

548548
[dev-dependencies]
549-
rand = "0.8.0"
550-
rand_chacha = "0.3.1"
549+
rand = "0.9.0"
550+
rand_chacha = "0.9.0"
551551
ron = "0.8.0"
552552
flate2 = "1.0"
553553
serde = { version = "1", features = ["derive"] }

benches/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ bevy_platform_support = { path = "../crates/bevy_platform_support", default-feat
2929
] }
3030

3131
# Other crates
32-
glam = "0.29"
33-
rand = "0.8"
34-
rand_chacha = "0.3"
32+
glam = { version = "0.30" }
33+
rand = "0.9"
34+
rand_chacha = "0.9"
3535

3636
# Make `bevy_render` compile on Linux with x11 windowing. x11 vs. Wayland does not matter here
3737
# because the benches do not actually open any windows.

benches/benches/bevy_ecs/observers/propagation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<const N: usize> Event for TestEvent<N> {
7070
}
7171

7272
fn send_events<const N: usize, const N_EVENTS: usize>(world: &mut World, leaves: &[Entity]) {
73-
let target = leaves.iter().choose(&mut rand::thread_rng()).unwrap();
73+
let target = leaves.iter().choose(&mut rand::rng()).unwrap();
7474

7575
(0..N_EVENTS).for_each(|_| {
7676
world.trigger_targets(TestEvent::<N> {}, *target);
@@ -111,7 +111,7 @@ fn add_listeners_to_hierarchy<const DENSITY: usize, const N: usize>(
111111
}
112112
let mut rng = deterministic_rand();
113113
for e in nodes.iter() {
114-
if rng.gen_bool(DENSITY as f64 / 100.0) {
114+
if rng.random_bool(DENSITY as f64 / 100.0) {
115115
world.entity_mut(*e).observe(empty_listener::<N>);
116116
}
117117
}

benches/benches/bevy_ecs/world/entity_hash.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ fn make_entity(rng: &mut impl Rng, size: usize) -> Entity {
1111
// * For ids, half are in [0, size), half are unboundedly larger.
1212
// * For generations, half are in [1, 3), half are unboundedly larger.
1313

14-
let x: f64 = rng.r#gen();
14+
let x: f64 = rng.random();
1515
let id = -(1.0 - x).log2() * (size as f64);
16-
let x: f64 = rng.r#gen();
16+
let x: f64 = rng.random();
1717
let generation = 1.0 + -(1.0 - x).log2() * 2.0;
1818

1919
// this is not reliable, but we're internal so a hack is ok

benches/benches/bevy_reflect/path.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::{fmt::Write, hint::black_box, str, time::Duration};
33
use benches::bench;
44
use bevy_reflect::ParsedPath;
55
use criterion::{criterion_group, BatchSize, BenchmarkId, Criterion, Throughput};
6-
use rand::{distributions::Uniform, Rng, SeedableRng};
6+
use rand::{distr::Uniform, Rng, SeedableRng};
77
use rand_chacha::ChaCha8Rng;
88

99
criterion_group!(benches, parse_reflect_path);
@@ -18,20 +18,20 @@ fn deterministic_rand() -> ChaCha8Rng {
1818
ChaCha8Rng::seed_from_u64(42)
1919
}
2020
fn random_ident(rng: &mut ChaCha8Rng, f: &mut dyn Write) {
21-
let between = Uniform::from(b'a'..=b'z');
22-
let ident_size = rng.gen_range(1..128);
21+
let between = Uniform::new_inclusive(b'a', b'z').unwrap();
22+
let ident_size = rng.random_range(1..128);
2323
let ident: Vec<u8> = rng.sample_iter(between).take(ident_size).collect();
2424
let ident = str::from_utf8(&ident).unwrap();
2525
let _ = write!(f, "{ident}");
2626
}
2727

2828
fn random_index(rng: &mut ChaCha8Rng, f: &mut dyn Write) {
29-
let index = rng.gen_range(1..128);
29+
let index = rng.random_range(1..128);
3030
let _ = write!(f, "{index}");
3131
}
3232

3333
fn write_random_access(rng: &mut ChaCha8Rng, f: &mut dyn Write) {
34-
match rng.gen_range(0..4) {
34+
match rng.random_range(0..4) {
3535
0 => {
3636
// Access::Field
3737
f.write_char('.').unwrap();

crates/bevy_color/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ serde = { version = "1.0", features = [
2121
thiserror = { version = "2", default-features = false }
2222
derive_more = { version = "1", default-features = false, features = ["from"] }
2323
wgpu-types = { version = "24", default-features = false, optional = true }
24-
encase = { version = "0.10", default-features = false, optional = true }
24+
encase = { git = "https://github.com/waywardmonkeys/encase/", branch = "update-deps", default-features = false, optional = true }
2525

2626
[features]
2727
default = ["std", "bevy_reflect", "encase"]

crates/bevy_ecs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ concurrent-queue = { version = "2.5.0", default-features = false, features = [
139139
] }
140140

141141
[dev-dependencies]
142-
rand = "0.8"
142+
rand = "0.9"
143143
static_assertions = "1.1.0"
144144
serde_test = "1.0"
145145

crates/bevy_ecs/examples/change_detection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ enum SimulationSet {
6666
// The entity will start with an age of 0 frames
6767
// If an entity gets spawned, we increase the counter in the EntityCounter resource
6868
fn spawn_entities(mut commands: Commands, mut entity_counter: ResMut<EntityCounter>) {
69-
if rand::thread_rng().gen_bool(0.6) {
69+
if rand::rng().random_bool(0.6) {
7070
let entity_id = commands.spawn(Age::default()).id();
7171
println!(" spawning {entity_id:?}");
7272
entity_counter.value += 1;

crates/bevy_ecs/examples/resources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Counter {
3737
}
3838

3939
fn increase_counter(mut counter: ResMut<Counter>) {
40-
if rand::thread_rng().gen_bool(0.5) {
40+
if rand::rng().random_bool(0.5) {
4141
counter.value += 1;
4242
println!(" Increased counter value");
4343
}

crates/bevy_math/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keywords = ["bevy"]
1010
rust-version = "1.85.0"
1111

1212
[dependencies]
13-
glam = { version = "0.29", default-features = false, features = ["bytemuck"] }
13+
glam = { version = "0.30", default-features = false, features = ["bytemuck"] }
1414
thiserror = { version = "2", default-features = false }
1515
derive_more = { version = "1", default-features = false, features = [
1616
"from",
@@ -22,8 +22,8 @@ serde = { version = "1", default-features = false, features = [
2222
], optional = true }
2323
libm = { version = "0.2", optional = true }
2424
approx = { version = "0.5", default-features = false, optional = true }
25-
rand = { version = "0.8", default-features = false, optional = true }
26-
rand_distr = { version = "0.4.3", optional = true }
25+
rand = { version = "0.9", default-features = false, optional = true }
26+
rand_distr = { version = "0.5", optional = true }
2727
smallvec = { version = "1.11" }
2828
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", default-features = false, features = [
2929
"glam",
@@ -33,11 +33,11 @@ variadics_please = "1.1"
3333
[dev-dependencies]
3434
approx = "0.5"
3535
# Supply rngs for examples and tests
36-
rand = "0.8"
37-
rand_chacha = "0.3"
36+
rand = "0.9"
37+
rand_chacha = "0.9"
3838
# Enable the approx feature when testing.
3939
bevy_math = { path = ".", default-features = false, features = ["approx"] }
40-
glam = { version = "0.29", default-features = false, features = ["approx"] }
40+
glam = { version = "0.30", default-features = false, features = ["approx"] }
4141

4242
[features]
4343
default = ["std", "rand", "curve"]

0 commit comments

Comments
 (0)