Skip to content

Commit 8c7fd35

Browse files
committed
Rollup merge of #26806 - cmr:stabilize-drain, r=Gankro
None
2 parents 4c7c7b7 + 8e2ce46 commit 8c7fd35

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/libcollections/vec_deque.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub struct VecDeque<T> {
4343
// tail and head are pointers into the buffer. Tail always points
4444
// to the first element that could be read, Head always points
4545
// to where data should be written.
46-
// If tail == head the buffer is empty. The length of the ringbuf
46+
// If tail == head the buffer is empty. The length of the ringbuffer
4747
// is defined as the distance between the two.
4848

4949
tail: usize,
@@ -309,7 +309,7 @@ impl<T> VecDeque<T> {
309309
}
310310

311311
/// Reserves capacity for at least `additional` more elements to be inserted in the given
312-
/// `Ringbuf`. The collection may reserve more space to avoid frequent reallocations.
312+
/// `VecDeque`. The collection may reserve more space to avoid frequent reallocations.
313313
///
314314
/// # Panics
315315
///
@@ -385,10 +385,10 @@ impl<T> VecDeque<T> {
385385
}
386386
}
387387

388-
/// Shrinks the capacity of the ringbuf as much as possible.
388+
/// Shrinks the capacity of the `VecDeque` as much as possible.
389389
///
390390
/// It will drop down as close as possible to the length but the allocator may still inform the
391-
/// ringbuf that there is space for a few more elements.
391+
/// `VecDeque` that there is space for a few more elements.
392392
///
393393
/// # Examples
394394
///
@@ -404,7 +404,7 @@ impl<T> VecDeque<T> {
404404
/// ```
405405
pub fn shrink_to_fit(&mut self) {
406406
// +1 since the ringbuffer always leaves one space empty
407-
// len + 1 can't overflow for an existing, well-formed ringbuf.
407+
// len + 1 can't overflow for an existing, well-formed ringbuffer.
408408
let target_cap = cmp::max(self.len() + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
409409
if target_cap < self.cap {
410410
// There are three cases of interest:
@@ -472,9 +472,9 @@ impl<T> VecDeque<T> {
472472
}
473473
}
474474

475-
/// Shortens a ringbuf, dropping excess elements from the back.
475+
/// Shortens a `VecDeque`, dropping excess elements from the back.
476476
///
477-
/// If `len` is greater than the ringbuf's current length, this has no
477+
/// If `len` is greater than the `VecDeque`'s current length, this has no
478478
/// effect.
479479
///
480480
/// # Examples
@@ -858,8 +858,8 @@ impl<T> VecDeque<T> {
858858
self.tail <= self.head
859859
}
860860

861-
/// Removes an element from anywhere in the ringbuf and returns it, replacing it with the last
862-
/// element.
861+
/// Removes an element from anywhere in the `VecDeque` and returns it, replacing it with the
862+
/// last element.
863863
///
864864
/// This does not preserve ordering, but is O(1).
865865
///
@@ -892,7 +892,7 @@ impl<T> VecDeque<T> {
892892
self.pop_back()
893893
}
894894

895-
/// Removes an element from anywhere in the ringbuf and returns it,
895+
/// Removes an element from anywhere in the `VecDeque` and returns it,
896896
/// replacing it with the first element.
897897
///
898898
/// This does not preserve ordering, but is O(1).
@@ -926,13 +926,13 @@ impl<T> VecDeque<T> {
926926
self.pop_front()
927927
}
928928

929-
/// Inserts an element at position `i` within the ringbuf. Whichever
929+
/// Inserts an element at position `i` within the `VecDeque`. Whichever
930930
/// end is closer to the insertion point will be moved to make room,
931931
/// and all the affected elements will be moved to new positions.
932932
///
933933
/// # Panics
934934
///
935-
/// Panics if `i` is greater than ringbuf's length
935+
/// Panics if `i` is greater than `VecDeque`'s length
936936
///
937937
/// # Examples
938938
/// ```
@@ -1132,7 +1132,7 @@ impl<T> VecDeque<T> {
11321132
}
11331133
}
11341134

1135-
/// Removes and returns the element at position `i` from the ringbuf.
1135+
/// Removes and returns the element at position `i` from the `VecDeque`.
11361136
/// Whichever end is closer to the removal point will be moved to make
11371137
/// room, and all the affected elements will be moved to new positions.
11381138
/// Returns `None` if `i` is out of bounds.
@@ -1428,7 +1428,7 @@ impl<T> VecDeque<T> {
14281428
}
14291429

14301430
impl<T: Clone> VecDeque<T> {
1431-
/// Modifies the ringbuf in-place so that `len()` is equal to new_len,
1431+
/// Modifies the `VecDeque` in-place so that `len()` is equal to new_len,
14321432
/// either by removing excess elements or by appending copies of a value to the back.
14331433
///
14341434
/// # Examples

0 commit comments

Comments
 (0)