summaryrefslogtreecommitdiffstats
path: root/examples/solar_system
diff options
context:
space:
mode:
authorLibravatar Sebastian <Sebastian@Strobl.net>2021-03-03 01:23:18 +0100
committerLibravatar Sebastian <Sebastian@Strobl.net>2021-03-03 01:23:18 +0100
commit5f27ed47207645bbb9fe2837675531584d88d394 (patch)
treec3930743d5f5e6c9c12e6622f9d20f55cadaa19d /examples/solar_system
parenta5fddf9ee648927b294ef34e8819855d5e117b26 (diff)
downloadiced-5f27ed47207645bbb9fe2837675531584d88d394.tar.gz
iced-5f27ed47207645bbb9fe2837675531584d88d394.tar.bz2
iced-5f27ed47207645bbb9fe2837675531584d88d394.zip
Update: rand
Diffstat (limited to 'examples/solar_system')
-rw-r--r--examples/solar_system/Cargo.toml2
-rw-r--r--examples/solar_system/src/main.rs8
2 files changed, 4 insertions, 6 deletions
diff --git a/examples/solar_system/Cargo.toml b/examples/solar_system/Cargo.toml
index 44ced729..327fe0aa 100644
--- a/examples/solar_system/Cargo.toml
+++ b/examples/solar_system/Cargo.toml
@@ -7,4 +7,4 @@ publish = false
[dependencies]
iced = { path = "../..", features = ["canvas", "tokio", "debug"] }
-rand = "0.7"
+rand = "0.8.3"
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 6a2de736..c8f74978 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -117,15 +117,13 @@ impl State {
(
Point::new(
rng.gen_range(
- -(width as f32) / 2.0,
- width as f32 / 2.0,
+ (-(width as f32) / 2.0)..(width as f32 / 2.0),
),
rng.gen_range(
- -(height as f32) / 2.0,
- height as f32 / 2.0,
+ (-(height as f32) / 2.0)..(height as f32 / 2.0),
),
),
- rng.gen_range(0.5, 1.0),
+ rng.gen_range(0.5..1.0),
)
})
.collect()