diff --git a/examples/src/bin/texture.rs b/examples/src/bin/texture.rs index e4ab27e..cdfd599 100644 --- a/examples/src/bin/texture.rs +++ b/examples/src/bin/texture.rs @@ -1,5 +1,5 @@ use std::default::Default; -use std::ffi::CString; +use std::ffi::CStr; use std::io::Cursor; use std::mem::{self, align_of}; use std::os::raw::c_void; @@ -573,7 +573,7 @@ fn main() { .create_pipeline_layout(&layout_create_info, None) .unwrap(); - let shader_entry_name = CString::new("main").unwrap(); + let shader_entry_name = CStr::from_bytes_with_nul_unchecked(b"main\0"); let shader_stage_create_infos = [ vk::PipelineShaderStageCreateInfo { module: vertex_shader_module, diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index cc322fc..1b6e6ff 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -2,7 +2,7 @@ use ash::util::*; use ash::vk; use examples::*; use std::default::Default; -use std::ffi::CString; +use std::ffi::CStr; use std::io::Cursor; use std::mem; use std::mem::align_of; @@ -226,7 +226,7 @@ fn main() { .create_pipeline_layout(&layout_create_info, None) .unwrap(); - let shader_entry_name = CString::new("main").unwrap(); + let shader_entry_name = CStr::from_bytes_with_nul_unchecked(b"main\0"); let shader_stage_create_infos = [ vk::PipelineShaderStageCreateInfo { module: vertex_shader_module, diff --git a/examples/src/lib.rs b/examples/src/lib.rs index 1142e1e..ab087e9 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -11,7 +11,7 @@ pub use ash::{Device, Instance}; use std::borrow::Cow; use std::cell::RefCell; use std::default::Default; -use std::ffi::{CStr, CString}; +use std::ffi::CStr; use std::ops::Drop; use std::os::raw::c_char; @@ -218,7 +218,7 @@ impl ExampleBase { .build(&event_loop) .unwrap(); let entry = Entry::linked(); - let app_name = CString::new("VulkanTriangle").unwrap(); + let app_name = CStr::from_bytes_with_nul_unchecked(b"VulkanTriangle\0"); let layer_names = [CStr::from_bytes_with_nul_unchecked( b"VK_LAYER_KHRONOS_validation\0", @@ -236,9 +236,9 @@ impl ExampleBase { extension_names_raw.push(DebugUtils::name().as_ptr()); let appinfo = vk::ApplicationInfo::builder() - .application_name(&app_name) + .application_name(app_name) .application_version(0) - .engine_name(&app_name) + .engine_name(app_name) .engine_version(0) .api_version(vk::make_api_version(0, 1, 0, 0));