Clearer wording
This commit is contained in:
parent
2982fe39ad
commit
8d3e55908a
@ -106,9 +106,9 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
|
|||||||
loop {
|
loop {
|
||||||
if len == buf.len() {
|
if len == buf.len() {
|
||||||
if buf.capacity() == buf.len() {
|
if buf.capacity() == buf.len() {
|
||||||
// reserve() rounds up our request to the nearest power of two,
|
// reserve() rounds up our request such that every request
|
||||||
// so after the first time the capacity is exceeded, we double
|
// (with maybe the exception of the first request) for the
|
||||||
// our capacity at each call to reserve.
|
// same amount of space doubles our capacity.
|
||||||
buf.reserve(min_cap_bump);
|
buf.reserve(min_cap_bump);
|
||||||
}
|
}
|
||||||
let new_area = buf.capacity() - buf.len();
|
let new_area = buf.capacity() - buf.len();
|
||||||
|
Loading…
Reference in New Issue
Block a user