File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 1446534271f01d38ff021cb7f92eb79551f1227b
5
+ refs/heads/try: 8e743b2981754f1aa7e0eb5b57d79e5a8ad7d172
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -1485,9 +1485,24 @@ fn as_c_str<T>(s: str, f: fn(*libc::c_char) -> T) -> T unsafe {
1485
1485
as_buf ( s) { |buf| f ( buf as * libc:: c_char ) }
1486
1486
}
1487
1487
1488
- #[ doc = "Allocate more memory for a string, up to `nn` + 1 bytes" ]
1489
- fn reserve ( & ss: str , nn : uint ) {
1490
- rustrt:: str_reserve_shared ( ss, nn) ;
1488
+ #[ doc = "
1489
+ Reserves capacity for exactly `n` bytes in the given string, not including
1490
+ the null terminator.
1491
+
1492
+ Assuming single-byte characters, the resulting string will be large
1493
+ enough to hold a string of length `n`. To account for the null terminator,
1494
+ the underlying buffer will have the size `n` + 1.
1495
+
1496
+ If the capacity for `s` is already equal to or greater than the requested
1497
+ capacity, then no action is taken.
1498
+
1499
+ # Arguments
1500
+
1501
+ * s - A string
1502
+ * n - The number of bytes to reserve space for
1503
+ " ]
1504
+ fn reserve ( & s: str , n : uint ) {
1505
+ rustrt:: str_reserve_shared ( s, n) ;
1491
1506
}
1492
1507
1493
1508
#[ doc = "Unsafe operations" ]
You can’t perform that action at this time.
0 commit comments