Rollup merge of #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 https://github.com/rust-lang/rust/pull/65948#issuecomment-589988183 .

This fixes it.
This commit is contained in:
Pietro Albini 2020-02-24 11:15:33 +01:00 committed by GitHub
commit c293ac9503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -669,7 +669,7 @@ impl<T> MaybeUninit<T> {
/// // Now we can use `buf` as a normal slice:
/// buf.sort_unstable();
/// assert!(
/// buf.chunks(2).all(|chunk| chunk[0] <= chunk[1]),
/// buf.windows(2).all(|pair| pair[0] <= pair[1]),
/// "buffer is sorted",
/// );
/// ```