Skip to content

Commit 719c734

Browse files
committed
Null pointers are optional
1 parent 298f8ee commit 719c734

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ pub struct CString {
137137
///
138138
/// Note that this structure is `repr(C)` and is can be
139139
/// placed in the signatures of FFI functions. A `&CStr` is equivalent to `*const c_char`,
140-
/// but offers a richer API.
140+
/// but offers a richer API. If you want to handle null pointers, too, using an
141+
/// `Option<&CStr>` will work.
141142
///
142143
/// # Examples
143144
///

0 commit comments

Comments
 (0)