about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-11-21 10:17:54 +0100
committerljedrz <ljedrz@gmail.com>2018-11-21 10:17:54 +0100
commit591607d237665857880e16899788517b9b82d414 (patch)
treeea9e3533ca622d73e5822b5fe6a520014dbf47ba /src/liballoc
parent464c9da9c229111298d413882735ea707a30e077 (diff)
downloadrust-591607d237665857880e16899788517b9b82d414.tar.gz
rust-591607d237665857880e16899788517b9b82d414.zip
String: add a FIXME to from_utf16
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/string.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index 8d009101ce7..0b25d911a29 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -618,6 +618,8 @@ impl String {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn from_utf16(v: &[u16]) -> Result<String, FromUtf16Error> {
+        // This isn't done via collect::<Result<_, _>>() for performance reasons.
+        // FIXME: the function can be simplified again when #48994 is closed.
         let mut ret = String::with_capacity(v.len());
         for c in decode_utf16(v.iter().cloned()) {
             if let Ok(c) = c {