We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a86884 + 258ef37 commit 68e0f28Copy full SHA for 68e0f28
src/liballoc/string.rs
@@ -622,6 +622,13 @@ impl String {
622
/// Decode a UTF-16 encoded slice `v` into a `String`, replacing
623
/// invalid data with the replacement character (U+FFFD).
624
///
625
+ /// Unlike [`from_utf8_lossy`] which returns a [`Cow<'a, str>`],
626
+ /// `from_utf16_lossy` returns a `String` since the UTF-16 to UTF-8
627
+ /// conversion requires a memory allocation.
628
+ ///
629
+ /// [`from_utf8_lossy`]: #method.from_utf8_lossy
630
+ /// [`Cow<'a, str>`]: ../borrow/enum.Cow.html
631
632
/// # Examples
633
634
/// Basic usage:
0 commit comments