未验证 提交 e392f5d9 编写于 作者: E Eric Huss 提交者: GitHub

Rollup merge of #89315 - et342:cstr_from_vec_unchecked_doc, r=yaahc

Clarify that `CString::from_vec_unchecked` appends 0 byte.
......@@ -409,6 +409,8 @@ fn _new(bytes: Vec<u8>) -> Result<CString, NulError> {
/// 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册