瀏覽代碼

Use `zeroed` instead of `unitialized`.

It's at least clear if it worked, then.
Lucas Stadler 10 年之前
父節點
當前提交
24965887e1
共有 1 個文件被更改,包括 1 次插入1 次删除
  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);