Macro raw_cstr

Source
macro_rules! raw_cstr {
    ($s: expr) => { ... };
}
Expand description

Converts a string slice to *const c_char.

The C-style string is guaranteed to be terminated by a nul byte. This trailing nul byte will be appended by this macro. The provided data should not contain any nul bytes in it.

This macro is const-context only.

See also cstr!

ยงExamples

use core::ffi::c_char;
const PRINTF_FMT: *const c_char = const_str::raw_cstr!("%d\n");