We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acab867 commit 851346dCopy full SHA for 851346d
1 file changed
src/chunk.rs
@@ -23,7 +23,7 @@ impl Chunk {
23
let voxel = shape.make_mut().as_voxels_mut().unwrap();
24
let mut voxels = 0;
25
unsafe {
26
- let ptr = cells.as_mut_ptr().as_mut().unwrap();
+ let ptr = cells.as_mut_ptr().cast::<Cell>();
27
for y in 0..CHUNK_MAP_HEIGHT {
28
for x in 0..CHUNK_MAP_HEIGHT {
29
let cell_index = MatrixIndex::new(x, y);
@@ -32,7 +32,7 @@ impl Chunk {
32
voxels += 1;
33
voxel.set_voxel(cell_index.into(), true);
34
}
35
- *ptr.index_mut(cell_index) = cell;
+ *ptr.add(cell_index.flatten().strict_cast()) = cell;
36
37
38
(
0 commit comments