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:
Manish Goregaokar 2015-05-17 11:55:40 +05:30
commit 99ed2c9f4b

View File

@ -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());
/// }