Skip to content

Commit

Permalink
Rollup merge of rust-lang#69386 - danielhenrymantilla:maybe_uninit_do…
Browse files Browse the repository at this point in the history
…cs_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.
  • Loading branch information
Dylan-DPC authored Feb 24, 2020
2 parents 6cc6a4b + 2cf339a commit 036c83b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
/// );
/// ```
Expand Down

0 comments on commit 036c83b

Please sign in to comment.