rust/mapgen/src/theme.rs
changeset 14156 74ca70cb753d
parent 14151 3c8a33ba06ba
child 14160 c24a76f131d6
--- a/rust/mapgen/src/theme.rs	Wed Nov 07 18:27:24 2018 +0300
+++ b/rust/mapgen/src/theme.rs	Wed Nov 07 18:30:33 2018 +0300
@@ -1,5 +1,5 @@
 use std::{
-    slice,
+    slice::from_raw_parts_mut,
     io,
     io::BufReader,
     fs::{File, read_dir},
@@ -69,9 +69,9 @@
                 let mut buffer: Vec<u32> = Vec::with_capacity(size.area());
                 let mut slice_u32 = buffer.as_mut_slice();
                 let mut slice_u8 = unsafe {
-                    slice::from_raw_parts_mut::<u8>(
-                        slice.as_mut_ptr() as *mut u8,
-                        slice.len() / 4
+                    from_raw_parts_mut::<u8>(
+                        slice_u32.as_mut_ptr() as *mut u8,
+                        slice_u32.len() / 4
                     )
                 };
                 reader.next_frame(slice_u8);