From 5f27ed47207645bbb9fe2837675531584d88d394 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 3 Mar 2021 01:23:18 +0100 Subject: [PATCH] Update: rand --- examples/solar_system/Cargo.toml | 2 +- examples/solar_system/src/main.rs | 8 +++----- 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()