diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index d6aa746f4cb..28f0b1fa967 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -415,8 +415,7 @@ impl CStr { /// /// unsafe { /// let slice = CStr::from_ptr(my_string()); - /// println!("string returned: {}", - /// str::from_utf8(slice.to_bytes()).unwrap()); + /// println!("string returned: {}", slice.to_str().unwrap()); /// } /// # } /// ```