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.
1 parent 464c9da commit 591607dCopy full SHA for 591607d
src/liballoc/string.rs
@@ -618,6 +618,8 @@ impl String {
618
/// ```
619
#[stable(feature = "rust1", since = "1.0.0")]
620
pub fn from_utf16(v: &[u16]) -> Result<String, FromUtf16Error> {
621
+ // This isn't done via collect::<Result<_, _>>() for performance reasons.
622
+ // FIXME: the function can be simplified again when #48994 is closed.
623
let mut ret = String::with_capacity(v.len());
624
for c in decode_utf16(v.iter().cloned()) {
625
if let Ok(c) = c {
0 commit comments