diff options
| author | Federico Mena Quintero <federico@gnome.org> | 2017-10-02 13:53:50 -0500 |
|---|---|---|
| committer | Federico Mena Quintero <federico@gnome.org> | 2017-10-02 13:53:50 -0500 |
| commit | 9854e836a35c3114c81b8102d3468ff9071b4141 (patch) | |
| tree | 4480e857e3c69620093f220a9df692bb4870455b /src/libstd | |
| parent | 4143422981e5be3593d3248e99cd503442aae698 (diff) | |
| download | rust-9854e836a35c3114c81b8102d3468ff9071b4141.tar.gz rust-9854e836a35c3114c81b8102d3468ff9071b4141.zip | |
Remove the implication that CString contains UTF-8 data.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 01d2b70e423..0d0280e2586 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -23,10 +23,11 @@ use ptr; use slice; use str::{self, Utf8Error}; -/// A type representing an owned, C-compatible, UTF-8 string. +/// A type representing an owned, C-compatible, nul-terminated string with no nul bytes in the +/// middle. /// /// This type serves the purpose of being able to safely generate a -/// C-compatible UTF-8 string from a Rust byte slice or vector. An instance of this +/// C-compatible string from a Rust byte slice or vector. An instance of this /// type is a static guarantee that the underlying bytes contain no interior 0 /// bytes ("nul characters") and that the final byte is 0 ("nul terminator"). /// @@ -443,7 +444,7 @@ impl CString { Box::into_raw(self.into_inner()) as *mut c_char } - /// Converts the `CString` into a [`String`] if it contains valid Unicode data. + /// Converts the `CString` into a [`String`] if it contains valid UTF-8 data. /// /// On failure, ownership of the original `CString` is returned. /// |
