]> git.nega.tv - josh/narcissus/commitdiff
narcissus-maths: Small cleanup of perlin noise
authorJoshua Simmons <josh@nega.tv>
Fri, 3 May 2024 06:35:18 +0000 (08:35 +0200)
committerJoshua Simmons <josh@nega.tv>
Fri, 3 May 2024 06:35:18 +0000 (08:35 +0200)
engine/narcissus-maths/src/perlin.rs

index 141c0a5e7209527dd0be483740803b1bd26e8140..de7dc6d9748e58c5ab7104562619325150e37813 100644 (file)
@@ -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() {