diff options
| author | et342 <34111964+et342@users.noreply.github.com> | 2021-09-28 05:51:52 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-28 05:51:52 +0500 |
| commit | dd0b5f48158ebeb29915fd53cd8f6ef01cc15a93 (patch) | |
| tree | de0d0279d13de514dfcc4168512671f9a6ecd91d | |
| parent | 8a12be741290b16c29293f87bdb3e8e5129bd4a9 (diff) | |
| download | rust-dd0b5f48158ebeb29915fd53cd8f6ef01cc15a93.tar.gz rust-dd0b5f48158ebeb29915fd53cd8f6ef01cc15a93.zip | |
Clarify that `CString::from_vec_unchecked` appends 0 byte.
| -rw-r--r-- | library/std/src/ffi/c_str.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs index ba084987f66..fe1f28f00c4 100644 --- a/library/std/src/ffi/c_str.rs +++ b/library/std/src/ffi/c_str.rs @@ -409,6 +409,8 @@ impl CString { /// Creates a C-compatible string by consuming a byte vector, /// without checking for interior 0 bytes. /// + /// Trailing 0 byte will be appended by this function. + /// /// This method is equivalent to [`CString::new`] except that no runtime /// assertion is made that `v` contains no 0 bytes, and it requires an /// actual byte vector, not anything that can be converted to one with Into. |
