]> git.nega.tv - josh/narcissus/commitdiff
vulkan-sys: Use &CStr directly in wrapper function
authorJoshua Simmons <josh@nega.tv>
Fri, 5 Apr 2024 22:20:21 +0000 (00:20 +0200)
committerJoshua Simmons <josh@nega.tv>
Fri, 5 Apr 2024 22:20:21 +0000 (00:20 +0200)
external/vulkan-sys/src/lib.rs

index ab2c3ad76df3dde748aaf31839562bf71a9526f1..6b47f64e6f0aace8d004b5b0bf8bf36876dcc85d 100644 (file)
@@ -558,9 +558,9 @@ impl InstanceFunctions {
     pub unsafe fn get_device_proc_addr(
         &self,
         device: Device,
-        name: *const c_char,
+        name: &CStr,
     ) -> Option<FnVoidFunction> {
-        (self.get_device_proc_addr)(device, name)
+        (self.get_device_proc_addr)(device, name.as_ptr())
     }
 }
 
@@ -691,7 +691,7 @@ impl DeviceFunctions {
             let load = |name: &CStr, function_version| {
                 if api_version >= function_version {
                     instance_functons
-                        .get_device_proc_addr(device, name.as_ptr())
+                        .get_device_proc_addr(device, name)
                         .unwrap_or_else(
                             #[cold]
                             || panic!("failed to load device function {}", name.to_string_lossy()),