Clarify that CString::from_vec_unchecked appends 0 byte.

This commit is contained in:
et342 2021-09-28 05:51:52 +05:00 committed by GitHub
parent 8a12be7412
commit dd0b5f4815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.