about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorMarijn Schouten <hkBst@users.noreply.github.com>2025-01-30 09:13:21 +0100
committerMarijn Schouten <mhkbst@gmail.com>2025-01-31 11:44:11 +0100
commit860476f6e0b400994caa09878646d4d9fd91b7b5 (patch)
treed7acc381afb6359cc3cdcb38b31a2faace5014aa /library/alloc/src
parente6f12c8b7d8d5c821c32fb2739ea01d1d874c58a (diff)
downloadrust-860476f6e0b400994caa09878646d4d9fd91b7b5.tar.gz
rust-860476f6e0b400994caa09878646d4d9fd91b7b5.zip
Update encode_utf16 to mention it is native endian
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/string.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 0c9535dfaa6..b29f740ef0f 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -712,8 +712,8 @@ impl String {
         }
     }
 
-    /// Decode a UTF-16–encoded vector `v` into a `String`, returning [`Err`]
-    /// if `v` contains any invalid data.
+    /// Decode a native endian UTF-16–encoded vector `v` into a `String`,
+    /// returning [`Err`] if `v` contains any invalid data.
     ///
     /// # Examples
     ///
@@ -745,8 +745,8 @@ impl String {
         Ok(ret)
     }
 
-    /// Decode a UTF-16–encoded slice `v` into a `String`, replacing
-    /// invalid data with [the replacement character (`U+FFFD`)][U+FFFD].
+    /// Decode a native endian UTF-16–encoded slice `v` into a `String`,
+    /// replacing invalid data with [the replacement character (`U+FFFD`)][U+FFFD].
     ///
     /// Unlike [`from_utf8_lossy`] which returns a [`Cow<'a, str>`],
     /// `from_utf16_lossy` returns a `String` since the UTF-16 to UTF-8
@@ -777,8 +777,8 @@ impl String {
             .collect()
     }
 
-    /// Decode a UTF-16LE–encoded vector `v` into a `String`, returning [`Err`]
-    /// if `v` contains any invalid data.
+    /// Decode a UTF-16LE–encoded vector `v` into a `String`,
+    /// returning [`Err`] if `v` contains any invalid data.
     ///
     /// # Examples
     ///
@@ -852,8 +852,8 @@ impl String {
         }
     }
 
-    /// Decode a UTF-16BE–encoded vector `v` into a `String`, returning [`Err`]
-    /// if `v` contains any invalid data.
+    /// Decode a UTF-16BE–encoded vector `v` into a `String`,
+    /// returning [`Err`] if `v` contains any invalid data.
     ///
     /// # Examples
     ///