cstr8!() { /* proc-macro */ }
Expand description

Builds a CStr8 literal at compile time from a string literal.

This will throw a compile error if an invalid character is in the passed string.

Example

assert_eq!(cstr8!("test").to_bytes_with_nul(), [116, 101, 115, 116, 0]);