macro_rules! c { ($s:literal) => { ... }; }
Expand description
Create a const &’static from a string literal.Utf8CStr
§Example
use lanyard::{Utf8CStr, c};
const HELLO: &Utf8CStr = c!("Hello, world!");
assert_eq!(HELLO, "Hello, world!");
assert_eq!(HELLO.as_str_with_nul(), "Hello, world!\0");Internal nul bytes will cause a compilation error:
ⓘ
const ERROR: &CStr8 = c!("Hello\0, world!");