Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rand requirement from 0.7 to 0.8 #1114

Merged
merged 2 commits into from
Jan 17, 2021
Merged
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bevy_internal = {path = "crates/bevy_internal", version = "0.4.0", default-featu

[dev-dependencies]
anyhow = "1.0"
rand = "0.7.3"
rand = "0.8.0"
ron = "0.6.2"
serde = {version = "1", features = ["derive"]}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_asset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ thiserror = "1.0"
downcast-rs = "1.2.0"
notify = { version = "5.0.0-pre.2", optional = true }
parking_lot = "0.11.0"
rand = "0.7.3"
rand = "0.8.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2" }
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bevy_tasks = { path = "../bevy_tasks", version = "0.4.0" }
bevy_utils = { path = "../bevy_utils", version = "0.4.0" }
bevy_ecs_macros = { path = "macros", version = "0.4.0" }
fxhash = "0.2"
rand = "0.7.3"
rand = "0.8.0"
serde = "1.0"
thiserror = "1.0"
fixedbitset = "0.3.1"
Expand Down
12 changes: 6 additions & 6 deletions examples/2d/contributors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ fn setup(
let mut rnd = rand::thread_rng();

for name in contribs {
let pos = (rnd.gen_range(-400.0, 400.0), rnd.gen_range(0.0, 400.0));
let dir = rnd.gen_range(-1.0, 1.0);
let pos = (rnd.gen_range(-400.0..400.0), rnd.gen_range(0.0..400.0));
let dir = rnd.gen_range(-1.0..1.0);
let velocity = Vec3::new(dir * 500.0, 0.0, 0.0);
let col = gen_color(&mut rnd);

Expand Down Expand Up @@ -254,7 +254,7 @@ fn collision_system(
if bottom < ground {
t.translation.y = ground + SPRITE_SIZE / 2.0;
// apply an impulse upwards
v.translation.y = rnd.gen_range(700.0, 1000.0);
v.translation.y = rnd.gen_range(700.0..1000.0);
}
if top > ceiling {
t.translation.y = ceiling - SPRITE_SIZE / 2.0;
Expand Down Expand Up @@ -312,9 +312,9 @@ fn contributors() -> Contributors {
/// Because there is no `Mul<Color> for Color` instead `[f32; 3]` is
/// used.
fn gen_color(rng: &mut impl Rng) -> [f32; 3] {
let r = rng.gen_range(0.2, 1.0);
let g = rng.gen_range(0.2, 1.0);
let b = rng.gen_range(0.2, 1.0);
let r = rng.gen_range(0.2..1.0);
let g = rng.gen_range(0.2..1.0);
let b = rng.gen_range(0.2..1.0);
let v = Vec3::new(r, g, b);
v.normalize().into()
}
10 changes: 5 additions & 5 deletions examples/3d/spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ fn setup(
mesh: cube_handle.clone(),
material: materials.add(StandardMaterial {
albedo: Color::rgb(
rng.gen_range(0.0, 1.0),
rng.gen_range(0.0, 1.0),
rng.gen_range(0.0, 1.0),
rng.gen_range(0.0..1.0),
rng.gen_range(0.0..1.0),
rng.gen_range(0.0..1.0),
),
..Default::default()
}),
transform: Transform::from_xyz(
rng.gen_range(-50.0, 50.0),
rng.gen_range(-50.0, 50.0),
rng.gen_range(-50.0..50.0),
rng.gen_range(-50.0..50.0),
0.0,
),
..Default::default()
Expand Down