提交 0d192c34 编写于 作者: A abhi 提交者: GitHub

Update VecDeque documentation to specify direction of index 0 (#34920)

上级 d15e2656
......@@ -402,6 +402,8 @@ pub fn with_capacity(n: usize) -> VecDeque<T> {
/// Retrieves an element in the `VecDeque` by index.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -425,6 +427,8 @@ pub fn get(&self, index: usize) -> Option<&T> {
/// Retrieves an element in the `VecDeque` mutably by index.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -456,6 +460,8 @@ pub fn get_mut(&mut self, index: usize) -> Option<&mut T> {
///
/// Fails if there is no element with either index.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -1180,6 +1186,8 @@ fn is_contiguous(&self) -> bool {
///
/// Returns `None` if `index` is out of bounds.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -1214,6 +1222,8 @@ pub fn swap_remove_back(&mut self, index: usize) -> Option<T> {
///
/// Returns `None` if `index` is out of bounds.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -1245,6 +1255,8 @@ pub fn swap_remove_front(&mut self, index: usize) -> Option<T> {
/// end is closer to the insertion point will be moved to make room,
/// and all the affected elements will be moved to new positions.
///
/// Element at index 0 is the front of the queue.
///
/// # Panics
///
/// Panics if `index` is greater than `VecDeque`'s length
......@@ -1472,6 +1484,8 @@ pub fn insert(&mut self, index: usize, value: T) {
/// room, and all the affected elements will be moved to new positions.
/// Returns `None` if `index` is out of bounds.
///
/// Element at index 0 is the front of the queue.
///
/// # Examples
///
/// ```
......@@ -1651,6 +1665,8 @@ pub fn remove(&mut self, index: usize) -> Option<T> {
///
/// Note that the capacity of `self` does not change.
///
/// Element at index 0 is the front of the queue.
///
/// # Panics
///
/// Panics if `at > len`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册