Skip to content

Commit 14ce603

Browse files
author
Yuki Okushi
authored
Rollup merge of #106562 - clubby789:vec-deque-example, r=Mark-Simulacrum
Clarify examples for `VecDeque::get/get_mut` Closes #106114 ``@rustbot`` label +A-docs
2 parents 3b5afa5 + fed3499 commit 14ce603

File tree

1 file changed

+3
-1
lines changed
  • library/alloc/src/collections/vec_deque

1 file changed

+3
-1
lines changed

library/alloc/src/collections/vec_deque/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
636636
/// buf.push_back(3);
637637
/// buf.push_back(4);
638638
/// buf.push_back(5);
639+
/// buf.push_back(6);
639640
/// assert_eq!(buf.get(1), Some(&4));
640641
/// ```
641642
#[stable(feature = "rust1", since = "1.0.0")]
@@ -661,10 +662,11 @@ impl<T, A: Allocator> VecDeque<T, A> {
661662
/// buf.push_back(3);
662663
/// buf.push_back(4);
663664
/// buf.push_back(5);
665+
/// buf.push_back(6);
666+
/// assert_eq!(buf[1], 4);
664667
/// if let Some(elem) = buf.get_mut(1) {
665668
/// *elem = 7;
666669
/// }
667-
///
668670
/// assert_eq!(buf[1], 7);
669671
/// ```
670672
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)