From c4d92d410b272a4b98af1aa90c2ab803b8999d05 Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Wed, 22 Aug 2018 10:51:05 +0300 Subject: [PATCH] Make enumerate_instance_version safe --- ash/src/entry.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ash/src/entry.rs b/ash/src/entry.rs index b91a3d9..3552ab6 100644 --- a/ash/src/entry.rs +++ b/ash/src/entry.rs @@ -191,12 +191,14 @@ impl Entry { pub trait EntryV1_1: EntryV1_0 { fn fp_v1_1(&self) -> &vk::EntryFnV1_1; - unsafe fn enumerate_instance_version(&self) -> VkResult { - let mut api_version = mem::uninitialized(); - let err_code = self.fp_v1_1().enumerate_instance_version(&mut api_version); - match err_code { - vk::Result::SUCCESS => Ok(api_version), - _ => Err(err_code), + fn enumerate_instance_version(&self) -> VkResult { + unsafe { + let mut api_version = 0; + let err_code = self.fp_v1_1().enumerate_instance_version(&mut api_version); + match err_code { + vk::Result::SUCCESS => Ok(api_version), + _ => Err(err_code), + } } } }