diff --git a/Cargo.toml b/Cargo.toml index 1d64856..ed6095f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ required-features = ["bin"] [dependencies] image = { version = "0.25", default-features = false } -rand = { version = "0.8", features = ["small_rng"] } +rand = { version = "0.9", features = ["small_rng"] } watch = { version = "0.2", features = ["parking_lot"] } # bin diff --git a/src/lib.rs b/src/lib.rs index 31fa83f..1dc709d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,9 +158,10 @@ pub mod primitives { } } /// enables using `rng.gen` to get a Vec3, with x,y,z between 0 and 1 - impl rand::distributions::Distribution for rand::distributions::Standard { + impl rand::distr::Distribution for rand::distr::StandardUniform { fn sample(&self, rng: &mut R) -> Vec3 { - Vec3::new(rng.gen(), rng.gen(), rng.gen()) + let values: [f64; 3] = rng.random(); + Vec3::new(values[0], values[1], values[2]) } } @@ -652,7 +653,7 @@ impl Runtime { zbuf: ImageBuffer::new(0, 0), max: 0, - rng: rand::rngs::SmallRng::from_entropy(), + rng: rand::rngs::SmallRng::from_os_rng(), } } /// Creates a new runtime from the dimensions of [`Config`]. @@ -744,7 +745,7 @@ impl Runtime { /// `rotation` is around [`View::center_camera`], in radians. #[allow(clippy::many_single_char_names)] pub fn render(config: &Config, runtime: &mut Runtime) { - let mut initial_point = runtime.rng.gen::() * 0.1; + let mut initial_point = runtime.rng.random::() * 0.1; // skip first 1000 to get good values in the attractor for _ in 0..1000 { initial_point = config.attractor.next_point(initial_point);