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 e78d902 commit a9de819Copy full SHA for a9de819
[refs]
@@ -1,5 +1,5 @@
1
---
2
-refs/heads/master: 7f12cc4e63657155f54fd734c791f66f5f6d9e20
+refs/heads/master: ebce09702f04640a545a41323f2d4a34c0023f9e
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
trunk/src/libcore/str.rs
@@ -1473,6 +1473,11 @@ pub pure fn from_utf16(v: &[u16]) -> ~str {
1473
move buf
1474
}
1475
1476
+pub pure fn with_capacity(capacity: uint) -> ~str {
1477
+ let mut buf = ~"";
1478
+ unsafe { reserve(&mut buf, capacity); }
1479
+ move buf
1480
+}
1481
1482
/**
1483
* As char_len but for a slice of a string
0 commit comments