enable slice_swap_unchecked feature in doc test

This commit is contained in:
ibraheemdev 2021-08-31 13:25:09 -04:00 committed by Ibraheem Ahmed
parent 1afe14ceed
commit 14769ce96f

View File

@ -583,6 +583,8 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// #![feature(slice_swap_unchecked)]
///
/// let mut v = ["a", "b", "c", "d"];
/// // SAFETY: we know that 1 and 3 are both indices of the slice
/// unsafe { v.swap_unchecked(1, 3) };