If doubling the vector in reserve() brings you over usize::MAX,
try to get capacity for usize::MAX
This commit is contained in:
parent
1caf260edb
commit
4f06cedd0d
1 changed files with 1 additions and 1 deletions
|
|
@ -309,7 +309,7 @@ impl<T> Vec<T> {
|
|||
|
||||
let new_min_cap = self.len.checked_add(additional).expect(err_msg);
|
||||
match new_min_cap.checked_next_power_of_two() {
|
||||
None => self.grow_capacity(new_min_cap),
|
||||
None => self.grow_capacity(usize::MAX),
|
||||
Some(x) => self.grow_capacity(x),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue