From ac24a0486e4493718ac954e4f0a3dac835961ebb Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Fri, 3 May 2024 08:35:18 +0200 Subject: [PATCH] narcissus-maths: Small cleanup of perlin noise --- engine/narcissus-maths/src/perlin.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/narcissus-maths/src/perlin.rs b/engine/narcissus-maths/src/perlin.rs index 141c0a5..de7dc6d 100644 --- a/engine/narcissus-maths/src/perlin.rs +++ b/engine/narcissus-maths/src/perlin.rs @@ -91,9 +91,9 @@ fn grad(index: usize, x: f32, y: f32, z: f32) -> f32 { // Unfortunately the compiler does not track the range of values in INDICES, // and so cannot see a bounds check is superflous here. Do it ourselves. - + // // SAFETY: const loop asserts all values in INDICES are in bounds for BASIS. - let [a, b, c] = unsafe { + let &[a, b, c] = unsafe { const _: () = { let mut i = 0; while i < INDICES.len() { -- 2.49.0