diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-05-17 11:55:40 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-05-17 11:55:40 +0530 |
| commit | 99ed2c9f4b10d86edce0e239acfd5769fd7f7214 (patch) | |
| tree | 71078bba88b28238dfc239bad22f48cf6dc602d3 /src/libstd | |
| parent | 8fa94747e434b5e4b4618278286dc39baa914f32 (diff) | |
| parent | e1f73b8e2bc8696f6ba21d44de7808cad861bb42 (diff) | |
| download | rust-99ed2c9f4b10d86edce0e239acfd5769fd7f7214.tar.gz rust-99ed2c9f4b10d86edce0e239acfd5769fd7f7214.zip | |
Rollup merge of #25516 - bstrie:cstrdoc, r=alexcrichton
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 3 |
1 files changed, 1 insertions, 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 @@ 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()); /// } |
