Skip to content

Commit 0d192c3

Browse files
Update VecDeque documentation to specify direction of index 0 (#34920)
1 parent d15e265 commit 0d192c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/libcollections/vec_deque.rs

+16
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ impl<T> VecDeque<T> {
402402

403403
/// Retrieves an element in the `VecDeque` by index.
404404
///
405+
/// Element at index 0 is the front of the queue.
406+
///
405407
/// # Examples
406408
///
407409
/// ```
@@ -425,6 +427,8 @@ impl<T> VecDeque<T> {
425427

426428
/// Retrieves an element in the `VecDeque` mutably by index.
427429
///
430+
/// Element at index 0 is the front of the queue.
431+
///
428432
/// # Examples
429433
///
430434
/// ```
@@ -456,6 +460,8 @@ impl<T> VecDeque<T> {
456460
///
457461
/// Fails if there is no element with either index.
458462
///
463+
/// Element at index 0 is the front of the queue.
464+
///
459465
/// # Examples
460466
///
461467
/// ```
@@ -1180,6 +1186,8 @@ impl<T> VecDeque<T> {
11801186
///
11811187
/// Returns `None` if `index` is out of bounds.
11821188
///
1189+
/// Element at index 0 is the front of the queue.
1190+
///
11831191
/// # Examples
11841192
///
11851193
/// ```
@@ -1214,6 +1222,8 @@ impl<T> VecDeque<T> {
12141222
///
12151223
/// Returns `None` if `index` is out of bounds.
12161224
///
1225+
/// Element at index 0 is the front of the queue.
1226+
///
12171227
/// # Examples
12181228
///
12191229
/// ```
@@ -1245,6 +1255,8 @@ impl<T> VecDeque<T> {
12451255
/// end is closer to the insertion point will be moved to make room,
12461256
/// and all the affected elements will be moved to new positions.
12471257
///
1258+
/// Element at index 0 is the front of the queue.
1259+
///
12481260
/// # Panics
12491261
///
12501262
/// Panics if `index` is greater than `VecDeque`'s length
@@ -1472,6 +1484,8 @@ impl<T> VecDeque<T> {
14721484
/// room, and all the affected elements will be moved to new positions.
14731485
/// Returns `None` if `index` is out of bounds.
14741486
///
1487+
/// Element at index 0 is the front of the queue.
1488+
///
14751489
/// # Examples
14761490
///
14771491
/// ```
@@ -1651,6 +1665,8 @@ impl<T> VecDeque<T> {
16511665
///
16521666
/// Note that the capacity of `self` does not change.
16531667
///
1668+
/// Element at index 0 is the front of the queue.
1669+
///
16541670
/// # Panics
16551671
///
16561672
/// Panics if `at > len`

0 commit comments

Comments
 (0)