Mercurial > touhou
diff examples/stdrenderer.rs @ 743:0fed350d1778
examples: Remove deprecated std::mem::uninitialized().
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 07 Jan 2020 12:34:11 +0100 |
parents | 0a250ddfae79 |
children | 5e5e7136ac92 |
line wrap: on
line diff
--- a/examples/stdrenderer.rs +++ b/examples/stdrenderer.rs @@ -149,7 +149,10 @@ fn main() { // Create the AnmRunner from the ANM and the sprite. let sprite = Rc::new(RefCell::new(Sprite::with_size(width, height))); let _anm_runner = AnmRunner::new(anms.clone(), quad.anm_script as u8, sprite.clone(), Rc::downgrade(&prng), 0); - let mut new_vertices: [Vertex; 6] = unsafe { std::mem::uninitialized() }; + let mut new_vertices: [Vertex; 6] = { + let data = std::mem::MaybeUninit::uninit(); + unsafe { data.assume_init() } + }; fill_vertices(sprite.clone(), &mut new_vertices, x, y, z); new_vertices[4] = new_vertices[0]; new_vertices[5] = new_vertices[2];