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 9a2286d commit 80eb616Copy full SHA for 80eb616
src/libcollections/string.rs
@@ -269,7 +269,7 @@ impl String {
269
/// ```
270
#[unstable = "error value in return may change"]
271
pub fn from_utf16(v: &[u16]) -> Option<String> {
272
- let mut s = String::with_capacity(v.len() / 2);
+ let mut s = String::with_capacity(v.len());
273
for c in str::utf16_items(v) {
274
match c {
275
str::ScalarValue(c) => s.push(c),
0 commit comments