Skip to content

Commit e1f73b8

Browse files
committedMay 17, 2015
Simplify CString doc comment
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
1 parent c23a9d4 commit e1f73b8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/libstd/ffi/c_str.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ use vec::Vec;
5353
/// fn my_printer(s: *const libc::c_char);
5454
/// }
5555
///
56-
/// let to_print = &b"Hello, world!"[..];
57-
/// let c_to_print = CString::new(to_print).unwrap();
56+
/// let c_to_print = CString::new("Hello, world!").unwrap();
5857
/// unsafe {
5958
/// my_printer(c_to_print.as_ptr());
6059
/// }

0 commit comments

Comments
 (0)
Please sign in to comment.