☰
Debian Codegraph
@
0.2.12-1
/
/
tests
/
pass
/
str_lit.rs
☽
☼
tests/pass/str_lit.rs
code
plain
raw
symbols
SCIP
MIT
2018-2024 Xidorn Quan <
[email protected]
>
debian/copyright
1
use
cstr::cstr;
2
use
std::ffi::
CStr
;
3
4
fn
main
() {
5
let
foo: &'static
CStr
=
cstr
!
(
"foo
\u{4e00}
bar"
);
6
let
expected =
b"foo
\xe4
\xb8
\x80
bar
\0
"
;
7
assert_eq
!
(foo,
CStr
::from_bytes_with_nul(expected).unwrap());
8
}