diff examples/anmrenderer.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/anmrenderer.rs
+++ b/examples/anmrenderer.rs
@@ -132,7 +132,10 @@ fn main() {
     let mut anm_runner = AnmRunner::new(anms, script, sprite.clone(), Rc::downgrade(&prng), 0);
 
     assert_eq!(std::mem::size_of::<Vertex>(), std::mem::size_of::<FakeVertex>());
-    let mut vertices: [Vertex; 4] = unsafe { std::mem::uninitialized() };
+    let mut vertices: [Vertex; 4] = {
+        let data = std::mem::MaybeUninit::uninit();
+        unsafe { data.assume_init() }
+    };
     fill_vertices(sprite.clone(), &mut vertices);
 
     // set the uniform interface to our type so that we can read textures from the shader