Skip to content

Commit 8d3e559

Browse files
author
bcoopers
committed
Clearer wording
1 parent 2982fe3 commit 8d3e559

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/io/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
106106
loop {
107107
if len == buf.len() {
108108
if buf.capacity() == buf.len() {
109-
// reserve() rounds up our request to the nearest power of two,
110-
// so after the first time the capacity is exceeded, we double
111-
// our capacity at each call to reserve.
109+
// reserve() rounds up our request such that every request
110+
// (with maybe the exception of the first request) for the
111+
// same amount of space doubles our capacity.
112112
buf.reserve(min_cap_bump);
113113
}
114114
let new_area = buf.capacity() - buf.len();

0 commit comments

Comments
 (0)