From 2d78db66c8e1bd549462323a6a82c73e2b90cd74 Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Thu, 5 Sep 2019 15:23:18 +0300 Subject: [PATCH] Adjust bogus documentation. --- src/mem.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mem.rs b/src/mem.rs index 429213d..3c606f9 100644 --- a/src/mem.rs +++ b/src/mem.rs @@ -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();