Skip to content

Commit

Permalink
Adjust wording
Browse files Browse the repository at this point in the history
  • Loading branch information
timvermeulen committed Sep 22, 2020
1 parent 3394849 commit e375c8d
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3078,10 +3078,11 @@ impl<T> [T] {
left
}

/// Removes and returns the portion of the slice specified by `range`.
/// Returns the subslice corresponding to the given range,
/// and modifies the slice to no longer include this subslice.
///
/// If the provided `range` starts or ends outside of the slice,
/// `None` is returned and the slice is not modified.
/// Returns `None` and does not modify the slice if the given
/// range is out of bounds.
///
/// # Examples
///
Expand Down Expand Up @@ -3140,10 +3141,11 @@ impl<T> [T] {
}
}

/// Removes and returns the portion of the mutable slice specified by `range`.
/// Returns the mutable subslice corresponding to the given range,
/// and modifies the slice to no longer include this subslice.
///
/// If the provided `range` starts or ends outside of the slice,
/// `None` is returned and the slice is not modified.
/// Returns `None` and does not modify the slice if the given
/// range is out of bounds.
///
/// # Examples
///
Expand Down Expand Up @@ -3205,9 +3207,8 @@ impl<T> [T] {
}
}

/// Takes the first element out of the slice.
///
/// Returns a reference pointing to the first element of the old slice.
/// Returns a reference to the first element of the slice,
/// and modifies the slice to no longer include this element.
///
/// Returns `None` if the slice is empty.
///
Expand All @@ -3228,9 +3229,8 @@ impl<T> [T] {
self.take(..=0).map(|res| &res[0])
}

/// Takes the first element out of the mutable slice.
///
/// Returns a mutable reference pointing to the first element of the old slice.
/// Returns a mutable reference to the first element of the slice,
/// and modifies the slice to no longer include this element.
///
/// Returns `None` if the slice is empty.
///
Expand All @@ -3252,9 +3252,8 @@ impl<T> [T] {
self.take_mut(..=0).map(|res| &mut res[0])
}

/// Takes the last element out of the slice.
///
/// Returns a reference pointing to the last element of the old slice.
/// Returns a reference to the last element of the slice,
/// and modifies the slice to no longer include this element.
///
/// Returns `None` if the slice is empty.
///
Expand All @@ -3275,9 +3274,8 @@ impl<T> [T] {
self.take((self.len() - 1)..).map(|res| &res[0])
}

/// Takes the last element out of the mutable slice.
///
/// Returns a mutable reference pointing to the last element of the old slice.
/// Returns a mutable reference to the last element of the slice,
/// and modifies the slice to no longer include this element.
///
/// Returns `None` if the slice is empty.
///
Expand Down

0 comments on commit e375c8d

Please sign in to comment.