Simplify CString doc comment
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
This commit is contained in:
parent
c23a9d42ea
commit
e1f73b8e2b
@ -53,8 +53,7 @@
|
||||
/// fn my_printer(s: *const libc::c_char);
|
||||
/// }
|
||||
///
|
||||
/// let to_print = &b"Hello, world!"[..];
|
||||
/// let c_to_print = CString::new(to_print).unwrap();
|
||||
/// let c_to_print = CString::new("Hello, world!").unwrap();
|
||||
/// unsafe {
|
||||
/// my_printer(c_to_print.as_ptr());
|
||||
/// }
|
||||
|
Loading…
Reference in New Issue
Block a user