Skip to content

Commit b34e0bd

Browse files
committed
DOC: fixing doc for reserve_cold()
1 parent 00be0d8 commit b34e0bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ impl<H, T> HeaderVec<H, T> {
255255
self.shrink_to(len)
256256
}
257257

258-
/// Resize the vector to have at least room for `additional` more elements.
259-
/// does exact resizing if `exact` is true.
258+
/// Resize the vector to least `requested_capacity` elements.
259+
/// Does exact resizing if `exact` is true.
260260
///
261261
/// Returns `Some(*const ())` if the memory was moved to a new location.
262262
///
@@ -265,7 +265,8 @@ impl<H, T> HeaderVec<H, T> {
265265
/// `requested_capacity` must be greater or equal than `self.len()`
266266
#[cold]
267267
unsafe fn resize_cold(&mut self, requested_capacity: usize, exact: bool) -> Option<*const ()> {
268-
// For efficiency we do only a debug_assert here
268+
// For efficiency we do only a debug_assert here, this is a internal unsafe function
269+
// it's contract should be already enforced by the caller which is under our control
269270
debug_assert!(
270271
self.len_exact() <= requested_capacity,
271272
"requested capacity is less than current length"

0 commit comments

Comments
 (0)