Skip to content

Commit e7e934e

Browse files
Rollup merge of #159821 - SzilvasiPeter:main, r=Darksonn
Update expect message using the recommended style in binary_heap module Related issue: #159751
2 parents 65804b2 + 10a5e9d commit e7e934e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

  • library/alloc/src/collections

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
12581258
///
12591259
/// Ok(heap.pop())
12601260
/// }
1261-
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
1261+
/// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
12621262
/// ```
12631263
#[stable(feature = "try_reserve_2", since = "1.63.0")]
12641264
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
@@ -1294,7 +1294,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
12941294
///
12951295
/// Ok(heap.pop())
12961296
/// }
1297-
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
1297+
/// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
12981298
/// ```
12991299
#[stable(feature = "try_reserve_2", since = "1.63.0")]
13001300
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
11531153
///
11541154
/// Ok(output)
11551155
/// }
1156-
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
1156+
/// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
11571157
/// ```
11581158
#[stable(feature = "try_reserve", since = "1.57.0")]
11591159
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
@@ -1201,7 +1201,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
12011201
///
12021202
/// Ok(output)
12031203
/// }
1204-
/// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
1204+
/// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail");
12051205
/// ```
12061206
#[stable(feature = "try_reserve", since = "1.57.0")]
12071207
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
@@ -3871,15 +3871,15 @@ impl<T, A: Allocator> Index<usize> for VecDeque<T, A> {
38713871

38723872
#[inline]
38733873
fn index(&self, index: usize) -> &T {
3874-
self.get(index).expect("Out of bounds access")
3874+
self.get(index).expect("out of bounds access")
38753875
}
38763876
}
38773877

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

0 commit comments

Comments
 (0)