From e1f73b8e2bc8696f6ba21d44de7808cad861bb42 Mon Sep 17 00:00:00 2001 From: Ben Striegel Date: Sat, 16 May 2015 22:30:25 -0400 Subject: [PATCH] Simplify CString doc comment No need for `&b"foo"[..]` to make a CString, `"foo"` will do. --- src/libstd/ffi/c_str.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 04513e9d048..b83a8efe1d0 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -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()); /// }