Rollup merge of #25516 - bstrie:cstrdoc, r=alexcrichton
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
This commit is contained in:
commit
99ed2c9f4b
@ -53,8 +53,7 @@ use vec::Vec;
|
||||
/// 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