File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -170,16 +170,8 @@ unsafe extern "system" fn vulkan_debug_callback(
170
170
_user_data : * mut std:: os:: raw:: c_void ,
171
171
) -> vk:: Bool32 {
172
172
let callback_data = unsafe { * p_callback_data } ;
173
- let message_id_name = if callback_data. p_message_id_name . is_null ( ) {
174
- Cow :: from ( "" )
175
- } else {
176
- unsafe { CStr :: from_ptr ( callback_data. p_message_id_name ) . to_string_lossy ( ) }
177
- } ;
178
- let message = if callback_data. p_message . is_null ( ) {
179
- Cow :: from ( "" )
180
- } else {
181
- unsafe { CStr :: from_ptr ( callback_data. p_message ) . to_string_lossy ( ) }
182
- } ;
173
+ let message_id_name = callback_data. message_id_name_as_c_str ( ) . unwrap_or ( c"" ) ;
174
+ let message = callback_data. message_as_c_str ( ) . unwrap_or ( c"" ) ;
183
175
println ! ( "{message_severity:?}: [{message_id_name}] : {message}" ) ;
184
176
vk:: FALSE
185
177
}
You can’t perform that action at this time.
0 commit comments