Skip to content

Commit d3c175a

Browse files
authored
Rollup merge of rust-lang#69386 - danielhenrymantilla:maybe_uninit_docs_replace_chunk_with_windows, r=Dylan-DPC
Fix minor error in `MaybeUninit::get_mut()` doc example In the `MaybeUninit::get_mut()` example I wanted to assert that the slice was sorted and mistakenly used `.chunks(2)` rather than `.windows(2)` to assert it, as @ametisf pointed out in rust-lang#65948 (comment) . This fixes it.
2 parents 5f16272 + 2cf339a commit d3c175a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/mem/maybe_uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl<T> MaybeUninit<T> {
669669
/// // Now we can use `buf` as a normal slice:
670670
/// buf.sort_unstable();
671671
/// assert!(
672-
/// buf.chunks(2).all(|chunk| chunk[0] <= chunk[1]),
672+
/// buf.windows(2).all(|pair| pair[0] <= pair[1]),
673673
/// "buffer is sorted",
674674
/// );
675675
/// ```

0 commit comments

Comments
 (0)