Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
///
/// Ok(heap.pop())
/// }
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
/// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
/// ```
#[stable(feature = "try_reserve_2", since = "1.63.0")]
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
Expand Down Expand Up @@ -1294,7 +1294,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
///
/// Ok(heap.pop())
/// }
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
/// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
/// ```
#[stable(feature = "try_reserve_2", since = "1.63.0")]
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
Expand Down
8 changes: 4 additions & 4 deletions library/alloc/src/collections/vec_deque/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// Ok(output)
/// }
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
/// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
/// ```
#[stable(feature = "try_reserve", since = "1.57.0")]
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
Expand Down Expand Up @@ -1201,7 +1201,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
///
/// Ok(output)
/// }
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
/// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
/// ```
#[stable(feature = "try_reserve", since = "1.57.0")]
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
Expand Down Expand Up @@ -3871,15 +3871,15 @@ impl<T, A: Allocator> Index<usize> for VecDeque<T, A> {

#[inline]
fn index(&self, index: usize) -> &T {
self.get(index).expect("Out of bounds access")
self.get(index).expect("out of bounds access")
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T, A: Allocator> IndexMut<usize> for VecDeque<T, A> {
#[inline]
fn index_mut(&mut self, index: usize) -> &mut T {
self.get_mut(index).expect("Out of bounds access")
self.get_mut(index).expect("out of bounds access")
}
}

Expand Down
Loading