Adjust bogus documentation.

This commit is contained in:
Henri Sivonen
2019-09-05 15:23:18 +03:00
parent 9e1c91adbb
commit 2d78db66c8
+3 -4
View File
@@ -1738,10 +1738,9 @@ pub fn convert_latin1_to_utf16(src: &[u8], dst: &mut [u16]) {
///
/// # Safety
///
/// Note that this function may write garbage beyond the number of bytes
/// indicated by the return value, so using a `&mut str` interpreted as
/// `&mut [u8]` as the destination is not safe. If you want to convert into
/// a `&mut str`, use `convert_utf16_to_str()` instead of this function.
/// If you want to convert into a `&mut str`, use
/// `convert_utf16_to_str_partial()` instead of using this function
/// together with the `unsafe` method `as_bytes_mut()` on `&mut str`.
pub fn convert_latin1_to_utf8_partial(src: &[u8], dst: &mut [u8]) -> (usize, usize) {
let src_len = src.len();
let src_ptr = src.as_ptr();