Skip to content

Commit fb93648

Browse files
authored
test
1 parent aa6f5ab commit fb93648

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: library/core/src/ffi/c_str.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ use crate::{fmt, ops, slice, str};
5555
/// Passing a Rust-originating C string:
5656
///
5757
/// ```
58-
/// use std::ffi::{CString, CStr};
58+
/// use std::ffi::CStr;
5959
/// use std::os::raw::c_char;
6060
///
6161
/// fn work(data: &CStr) {
62-
/// # /* Extern functions are awkward in doc comments - fake it instead
63-
/// extern "C" { fn work_with(data: *const c_char); }
64-
/// # */ unsafe extern "C" fn work_with(s: *const c_char) {}
65-
///
62+
/// unsafe extern "C" fn work_with(s: *const c_char) {}
6663
/// unsafe { work_with(data.as_ptr()) }
6764
/// }
6865
///
69-
/// let s = CString::new("data data data data").expect("CString::new failed");
66+
/// let s = c"Hello world!";
7067
/// work(&s);
7168
/// ```
7269
///

0 commit comments

Comments
 (0)