Remove len argument from RawVec::reserve_for_push because it's always equal to capacity. Also make Vec::insert use reserve_for_push.
This commit is contained in:
@@ -349,8 +349,8 @@ impl<T, A: Allocator> RawVec<T, A> {
|
||||
/// oft-instantiated `Vec::push()`, which does its own capacity check.
|
||||
#[cfg(not(no_global_oom_handling))]
|
||||
#[inline(never)]
|
||||
pub fn reserve_for_push(&mut self, len: usize) {
|
||||
if let Err(err) = self.grow_amortized(len, 1) {
|
||||
pub fn reserve_for_push(&mut self) {
|
||||
if let Err(err) = self.grow_amortized(self.cap.0, 1) {
|
||||
handle_error(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user