diff --git a/src/accel/bvh.rs b/src/accel/bvh.rs index 731a3f1..b6b3fdf 100644 --- a/src/accel/bvh.rs +++ b/src/accel/bvh.rs @@ -172,7 +172,7 @@ impl<'a> BVH<'a> { children_indices, split_axis, } => { - let mut node = unsafe { arena.alloc_uninitialized_with_alignment::(32) }; + let node = unsafe { arena.alloc_uninitialized_with_alignment::(32) }; let bounds = arena .copy_slice_with_alignment(&base.bounds[bounds_range.0..bounds_range.1], 32); @@ -193,7 +193,7 @@ impl<'a> BVH<'a> { bounds_range, object_range, } => { - let mut node = unsafe { arena.alloc_uninitialized::() }; + let node = unsafe { arena.alloc_uninitialized::() }; let bounds = arena.copy_slice(&base.bounds[bounds_range.0..bounds_range.1]); *node = BVHNode::Leaf { diff --git a/src/accel/bvh4.rs b/src/accel/bvh4.rs index 47595a7..e5ce96d 100644 --- a/src/accel/bvh4.rs +++ b/src/accel/bvh4.rs @@ -275,7 +275,7 @@ impl<'a> BVH4<'a> { .copy_slice_with_alignment(&base.bounds[bounds_range.0..bounds_range.1], 32); // Build children - let mut children_mem = unsafe { + let children_mem = unsafe { arena.alloc_array_uninitialized_with_alignment::(child_count, 32) }; for i in 0..child_count { diff --git a/src/surface/triangle_mesh.rs b/src/surface/triangle_mesh.rs index d3e0ca7..f8cf490 100644 --- a/src/surface/triangle_mesh.rs +++ b/src/surface/triangle_mesh.rs @@ -37,7 +37,7 @@ impl<'a> TriangleMesh<'a> { // Copy verts over to a contiguous area of memory, reorganizing them // so that each vertices' time samples are contiguous in memory. let vertices = { - let mut vertices = + let vertices = unsafe { arena.alloc_array_uninitialized(vert_count * time_sample_count) }; for vi in 0..vert_count { @@ -53,7 +53,7 @@ impl<'a> TriangleMesh<'a> { // above. let normals = match vert_normals { Some(ref vnors) => { - let mut normals = + let normals = unsafe { arena.alloc_array_uninitialized(vert_count * time_sample_count) }; for vi in 0..vert_count { @@ -70,7 +70,7 @@ impl<'a> TriangleMesh<'a> { // Copy triangle vertex indices over, appending the triangle index itself to the tuple let indices = { - let mut indices = unsafe { arena.alloc_array_uninitialized(tri_indices.len()) }; + let indices = unsafe { arena.alloc_array_uninitialized(tri_indices.len()) }; for (i, tri_i) in tri_indices.iter().enumerate() { indices[i] = (tri_i.0 as u32, tri_i.2 as u32, tri_i.1 as u32, i as u32); }