fune/third_party/rust/cstr/tests/pass/byte_str_lit.rs

7 lines
176 B
Rust

use cstr::cstr;
use std::ffi::CStr;
fn main() {
let foo: &'static CStr = cstr!(b"foo\xffbar");
assert_eq!(foo, CStr::from_bytes_with_nul(b"foo\xffbar\0").unwrap());
}