diff --git a/src/accel/bvh4.rs b/src/accel/bvh4.rs index f94e4dd..87163c4 100644 --- a/src/accel/bvh4.rs +++ b/src/accel/bvh4.rs @@ -56,7 +56,7 @@ impl<'a> BVH4<'a> { } else { let base = BVHBase::from_objects(objects, objects_per_leaf, bounder); - let mut root = unsafe { arena.alloc_uninitialized::() }; + let root = unsafe { arena.alloc_uninitialized::() }; BVH4::construct_from_base(arena, &base, base.root_node_index(), root); BVH4 { root: Some(root), diff --git a/src/accel/light_tree.rs b/src/accel/light_tree.rs index caa7471..4db2952 100644 --- a/src/accel/light_tree.rs +++ b/src/accel/light_tree.rs @@ -73,7 +73,7 @@ impl<'a> LightTree<'a> { let mut builder = LightTreeBuilder::new(); builder.recursive_build(0, 0, objects, &info_getter); - let mut root = unsafe { arena.alloc_uninitialized::() }; + let root = unsafe { arena.alloc_uninitialized::() }; LightTree::construct_from_builder(arena, &builder, builder.root_node_index(), root); LightTree { @@ -105,7 +105,7 @@ impl<'a> LightTree<'a> { let bounds = arena.copy_slice(&base.bounds[bounds_range.0..bounds_range.1]); let child_count = base.node_child_count(node_index); - let mut children = unsafe { arena.alloc_array_uninitialized::(child_count) }; + let children = unsafe { arena.alloc_array_uninitialized::(child_count) }; for i in 0..child_count { LightTree::construct_from_builder( arena, diff --git a/src/surface/triangle_mesh.rs b/src/surface/triangle_mesh.rs index b06ed34..ea4df3c 100644 --- a/src/surface/triangle_mesh.rs +++ b/src/surface/triangle_mesh.rs @@ -67,7 +67,7 @@ impl<'a> TriangleMesh<'a> { }; // Copy triangle vertex indices over, appending the triangle index itself to the tuple - let mut indices = { + let indices = { let mut 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); diff --git a/src/tracer.rs b/src/tracer.rs index e855dc4..bebb4cf 100644 --- a/src/tracer.rs +++ b/src/tracer.rs @@ -114,7 +114,7 @@ impl<'a> TracerInner<'a> { &mut [], ] }; - let mut ray_sets = if inst.transform_indices.is_some() { + let ray_sets = if inst.transform_indices.is_some() { &mut tmp[..] } else { &mut tmp[..1] diff --git a/sub_crates/mem_arena/src/lib.rs b/sub_crates/mem_arena/src/lib.rs index 5f5921d..e8b02a2 100644 --- a/sub_crates/mem_arena/src/lib.rs +++ b/sub_crates/mem_arena/src/lib.rs @@ -105,7 +105,7 @@ impl MemArena { /// Allocates memory for and initializes a type T, returning a mutable reference to it. pub fn alloc<'a, T: Copy>(&'a self, value: T) -> &'a mut T { - let mut memory = unsafe { self.alloc_uninitialized() }; + let memory = unsafe { self.alloc_uninitialized() }; *memory = value; memory } @@ -115,7 +115,7 @@ impl MemArena { /// Additionally, the allocation will be made with the given byte alignment or /// the type's inherent alignment, whichever is greater. pub fn alloc_with_alignment<'a, T: Copy>(&'a self, value: T, align: usize) -> &'a mut T { - let mut memory = unsafe { self.alloc_uninitialized_with_alignment(align) }; + let memory = unsafe { self.alloc_uninitialized_with_alignment(align) }; *memory = value; memory }