Skip to content

Commit

Permalink
docs: slice::strip_prefix and strip_suffix, fold in sentence
Browse files Browse the repository at this point in the history
Roughly as requested by @LukasKalbertodt.  I still prefer clearly
making these two cases.

Signed-off-by: Ian Jackson <[email protected]>
  • Loading branch information
ijackson committed Oct 12, 2020
1 parent 6f5e96f commit 22358c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1704,11 +1704,10 @@ impl<T> [T] {
/// Returns a subslice with the prefix removed.
///
/// If the slice starts with `prefix`, returns the subslice after the prefix, wrapped in `Some`.
/// If `prefix` is empty, simply returns the original slice.
///
/// If the slice does not start with `prefix`, returns `None`.
///
/// (If `prefix` is empty, simply returns the original slice.)
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -1738,11 +1737,10 @@ impl<T> [T] {
/// Returns a subslice with the suffix removed.
///
/// If the slice ends with `suffix`, returns the subslice before the suffix, wrapped in `Some`.
/// If `suffix` is empty, simply returns the original slice.
///
/// If the slice does not end with `suffix`, returns `None`.
///
/// (If `suffix` is empty, simply returns the original slice.)
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit 22358c6

Please sign in to comment.