Rename reserve_for_push to grow_one and fix comment.

This commit is contained in:
Cai Bear
2024-03-28 16:38:01 -07:00
parent 78dc89b0d5
commit aba592d09c
3 changed files with 6 additions and 6 deletions

View File

@@ -345,11 +345,11 @@ impl<T, A: Allocator> RawVec<T, A> {
}
}
/// A specialized version of `reserve()` used only by the hot and
/// oft-instantiated `Vec::push()`, which does its own capacity check.
/// A specialized version of `self.reserve(len, 1)` which requires the
/// caller to ensure `len == self.capacity()`.
#[cfg(not(no_global_oom_handling))]
#[inline(never)]
pub fn reserve_for_push(&mut self) {
pub fn grow_one(&mut self) {
if let Err(err) = self.grow_amortized(self.cap.0, 1) {
handle_error(err);
}