Skip to content

Commit 53f3130

Browse files
authored
Rollup merge of #71219 - JOE1994:patch-4, r=Mark-Simulacrum
Minor fixes to doc comments of 'VecDeque' 1. Changed descriptions of `fn get` & `fn get_mut`. Since both of these functions are returning references, and not the owned value, I thought the doc comments could be fixed to be consistent with doc comments of `fn front` & `fn front_mut`. 2. Other changes are minor fixes or additions for clarification. Thank you for taking a look :)
2 parents 42aab58 + 9707bec commit 53f3130

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/liballoc/collections/vec_deque.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ impl<T> VecDeque<T> {
488488
VecDeque { tail: 0, head: 0, buf: RawVec::with_capacity(cap) }
489489
}
490490

491-
/// Retrieves an element in the `VecDeque` by index.
491+
/// Provides a reference to the element at the given index.
492492
///
493493
/// Element at index 0 is the front of the queue.
494494
///
@@ -513,7 +513,7 @@ impl<T> VecDeque<T> {
513513
}
514514
}
515515

516-
/// Retrieves an element in the `VecDeque` mutably by index.
516+
/// Provides a mutable reference to the element at the given index.
517517
///
518518
/// Element at index 0 is the front of the queue.
519519
///
@@ -651,7 +651,7 @@ impl<T> VecDeque<T> {
651651
}
652652
}
653653

654-
/// Tries to reserves the minimum capacity for exactly `additional` more elements to
654+
/// Tries to reserve the minimum capacity for exactly `additional` more elements to
655655
/// be inserted in the given `VecDeque<T>`. After calling `reserve_exact`,
656656
/// capacity will be greater than or equal to `self.len() + additional`.
657657
/// Does nothing if the capacity is already sufficient.
@@ -662,7 +662,7 @@ impl<T> VecDeque<T> {
662662
///
663663
/// # Errors
664664
///
665-
/// If the capacity overflows, or the allocator reports a failure, then an error
665+
/// If the capacity overflows `usize`, or the allocator reports a failure, then an error
666666
/// is returned.
667667
///
668668
/// # Examples
@@ -678,7 +678,7 @@ impl<T> VecDeque<T> {
678678
/// // Pre-reserve the memory, exiting if we can't
679679
/// output.try_reserve_exact(data.len())?;
680680
///
681-
/// // Now we know this can't OOM in the middle of our complex work
681+
/// // Now we know this can't OOM(Out-Of-Memory) in the middle of our complex work
682682
/// output.extend(data.iter().map(|&val| {
683683
/// val * 2 + 5 // very complicated
684684
/// }));
@@ -700,7 +700,7 @@ impl<T> VecDeque<T> {
700700
///
701701
/// # Errors
702702
///
703-
/// If the capacity overflows, or the allocator reports a failure, then an error
703+
/// If the capacity overflows `usize`, or the allocator reports a failure, then an error
704704
/// is returned.
705705
///
706706
/// # Examples

0 commit comments

Comments
 (0)