Yuki Okushi 2021-01-12 16:13:31 +09:00 committed by GitHub
commit 961a4386cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1357,14 +1357,11 @@ impl<T> [T] {
///
/// ```
/// let mut v = [1, 0, 3, 0, 5, 6];
/// // scoped to restrict the lifetime of the borrows
/// {
/// let (left, right) = v.split_at_mut(2);
/// assert_eq!(left, [1, 0]);
/// assert_eq!(right, [3, 0, 5, 6]);
/// left[1] = 2;
/// right[1] = 4;
/// }
/// let (left, right) = v.split_at_mut(2);
/// assert_eq!(left, [1, 0]);
/// assert_eq!(right, [3, 0, 5, 6]);
/// left[1] = 2;
/// right[1] = 4;
/// assert_eq!(v, [1, 2, 3, 4, 5, 6]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]