Parcourir la Source

Use `zeroed` instead of `unitialized`.

It's at least clear if it worked, then.
Lucas Stadler 10 ans auparavant
Parent
commit
24965887e1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      rust/coffi/src/main.rs

+ 1 - 1
rust/coffi/src/main.rs

@ -33,7 +33,7 @@ fn main() {
33 33
34 34
    let mut img: png_image;
35 35
    unsafe {
36
        img = std::mem::uninitialized();
36
        img = std::mem::zeroed();
37 37
        let res = png_image_begin_read_from_file(&mut img, "mei.png".as_ptr());
38 38
        println!("read_from_file: {}", res);
39 39
        println!("{}x{}", img.width, img.height);