Macro fmod::c

source ·
macro_rules! c {
    ($s:literal) => { ... };
}
Expand description

Create a const &’static Utf8CStr from a string literal.

§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!");