rusticl: Use C-string literals

They got stabilized with Rust 1.77.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
This commit is contained in:
LingMan
2024-10-03 17:04:53 +02:00
committed by Marge Bot
parent 62b8e053f7
commit 612ad0cb70
2 changed files with 4 additions and 3 deletions
@@ -7,6 +7,7 @@ use mesa_rust_gen::*;
use mesa_rust_util::serialize::*;
use mesa_rust_util::string::*;
use std::ffi::CStr;
use std::ffi::CString;
use std::fmt::Debug;
use std::os::raw::c_char;
@@ -14,7 +15,7 @@ use std::os::raw::c_void;
use std::ptr;
use std::slice;
const INPUT_STR: *const c_char = b"input.cl\0".as_ptr().cast();
const INPUT_STR: &CStr = c"input.cl";
pub enum SpecConstant {
None,
@@ -140,7 +141,7 @@ impl SPIRVBin {
headers: c_headers.as_ptr(),
num_headers: c_headers.len() as u32,
source: clc_named_value {
name: INPUT_STR,
name: INPUT_STR.as_ptr(),
value: source.as_ptr(),
},
args: c_args.as_ptr(),
@@ -357,7 +357,7 @@ impl PipeScreen {
});
if ptr.is_null() {
// this string is good enough to pass the CTS
CStr::from_bytes_with_nul(b"v0000-01-01-00\0").unwrap()
c"v0000-01-01-00"
} else {
CStr::from_ptr(ptr)
}