Macro byte_strings::const_::c_str [−][src]
macro_rules! c_str {
() => { ... };
($($s : expr), * $(,) ?) => { ... };
}Expand description
const-friendly version of
c_str!.
use ::byte_strings::const_;
const MESSAGE: &str = "Hello, World!";
const C_MESSAGE: &const_::CStr = const_::c_str!(MESSAGE);Inner null bytes are still rejected at compile time:
ⓘ
use ::byte_strings::const_;
const MESSAGE: &str = "Hell\0, World!";
const C_MESSAGE: &const_::CStr = const_::c_str!(MESSAGE); // Error.