# HG changeset patch # User alfadur # Date 1541604633 -10800 # Node ID 74ca70cb753d6bd7792928c2ba3a53af01e01a7d # Parent 8f82d87d223fc3beddd4aba731f2074c29160a7e fix mapgen diff -r 8f82d87d223f -r 74ca70cb753d rust/mapgen/src/lib.rs --- a/rust/mapgen/src/lib.rs Wed Nov 07 18:27:24 2018 +0300 +++ b/rust/mapgen/src/lib.rs Wed Nov 07 18:30:33 2018 +0300 @@ -14,7 +14,7 @@ }; use rand::{thread_rng, Rng}; use land2d::Land2D; -use theme::Theme; +use self::theme::Theme; #[derive(Deserialize)] struct PointDesc { diff -r 8f82d87d223f -r 74ca70cb753d rust/mapgen/src/theme.rs --- 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 = Vec::with_capacity(size.area()); let mut slice_u32 = buffer.as_mut_slice(); let mut slice_u8 = unsafe { - slice::from_raw_parts_mut::( - slice.as_mut_ptr() as *mut u8, - slice.len() / 4 + from_raw_parts_mut::( + slice_u32.as_mut_ptr() as *mut u8, + slice_u32.len() / 4 ) }; reader.next_frame(slice_u8);