@@ -43,7 +43,7 @@ pub struct VecDeque<T> {
43
43
// tail and head are pointers into the buffer. Tail always points
44
44
// to the first element that could be read, Head always points
45
45
// 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
47
47
// is defined as the distance between the two.
48
48
49
49
tail : usize ,
@@ -309,7 +309,7 @@ impl<T> VecDeque<T> {
309
309
}
310
310
311
311
/// 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.
313
313
///
314
314
/// # Panics
315
315
///
@@ -385,10 +385,10 @@ impl<T> VecDeque<T> {
385
385
}
386
386
}
387
387
388
- /// Shrinks the capacity of the ringbuf as much as possible.
388
+ /// Shrinks the capacity of the `VecDeque` as much as possible.
389
389
///
390
390
/// 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.
392
392
///
393
393
/// # Examples
394
394
///
@@ -404,7 +404,7 @@ impl<T> VecDeque<T> {
404
404
/// ```
405
405
pub fn shrink_to_fit ( & mut self ) {
406
406
// +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 .
408
408
let target_cap = cmp:: max ( self . len ( ) + 1 , MINIMUM_CAPACITY + 1 ) . next_power_of_two ( ) ;
409
409
if target_cap < self . cap {
410
410
// There are three cases of interest:
@@ -472,9 +472,9 @@ impl<T> VecDeque<T> {
472
472
}
473
473
}
474
474
475
- /// Shortens a ringbuf , dropping excess elements from the back.
475
+ /// Shortens a `VecDeque` , dropping excess elements from the back.
476
476
///
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
478
478
/// effect.
479
479
///
480
480
/// # Examples
@@ -858,8 +858,8 @@ impl<T> VecDeque<T> {
858
858
self . tail <= self . head
859
859
}
860
860
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.
863
863
///
864
864
/// This does not preserve ordering, but is O(1).
865
865
///
@@ -892,7 +892,7 @@ impl<T> VecDeque<T> {
892
892
self . pop_back ( )
893
893
}
894
894
895
- /// Removes an element from anywhere in the ringbuf and returns it,
895
+ /// Removes an element from anywhere in the `VecDeque` and returns it,
896
896
/// replacing it with the first element.
897
897
///
898
898
/// This does not preserve ordering, but is O(1).
@@ -926,13 +926,13 @@ impl<T> VecDeque<T> {
926
926
self . pop_front ( )
927
927
}
928
928
929
- /// Inserts an element at position `i` within the ringbuf . Whichever
929
+ /// Inserts an element at position `i` within the `VecDeque` . Whichever
930
930
/// end is closer to the insertion point will be moved to make room,
931
931
/// and all the affected elements will be moved to new positions.
932
932
///
933
933
/// # Panics
934
934
///
935
- /// Panics if `i` is greater than ringbuf 's length
935
+ /// Panics if `i` is greater than `VecDeque` 's length
936
936
///
937
937
/// # Examples
938
938
/// ```
@@ -1132,7 +1132,7 @@ impl<T> VecDeque<T> {
1132
1132
}
1133
1133
}
1134
1134
1135
- /// Removes and returns the element at position `i` from the ringbuf .
1135
+ /// Removes and returns the element at position `i` from the `VecDeque` .
1136
1136
/// Whichever end is closer to the removal point will be moved to make
1137
1137
/// room, and all the affected elements will be moved to new positions.
1138
1138
/// Returns `None` if `i` is out of bounds.
@@ -1428,7 +1428,7 @@ impl<T> VecDeque<T> {
1428
1428
}
1429
1429
1430
1430
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,
1432
1432
/// either by removing excess elements or by appending copies of a value to the back.
1433
1433
///
1434
1434
/// # Examples
0 commit comments