| 1 |
use cstr::cstr; |
| 2 |
use std::ffi::CStr; |
| 3 |
|
| 4 |
fn main() { |
| 5 |
let foo: &'static CStr = cstr!(foobar); |
| 6 |
assert_eq!(foo, CStr::from_bytes_with_nul(b"foobar\0").unwrap()); |
| 7 |
let foo: &'static CStr = cstr!(r#foobar); |
| 8 |
assert_eq!(foo, CStr::from_bytes_with_nul(b"r#foobar\0").unwrap()); |
| 9 |
} |