docs: slice::strip_prefix
and strip_suffix
, fold in sentence
Roughly as requested by @LukasKalbertodt. I still prefer clearly making these two cases. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
parent
6f5e96fb5f
commit
22358c650b
1 changed files with 2 additions and 4 deletions
|
@ -1704,11 +1704,10 @@ impl<T> [T] {
|
||||||
/// Returns a subslice with the prefix removed.
|
/// Returns a subslice with the prefix removed.
|
||||||
///
|
///
|
||||||
/// If the slice starts with `prefix`, returns the subslice after the prefix, wrapped in `Some`.
|
/// 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 the slice does not start with `prefix`, returns `None`.
|
||||||
///
|
///
|
||||||
/// (If `prefix` is empty, simply returns the original slice.)
|
|
||||||
///
|
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -1738,11 +1737,10 @@ impl<T> [T] {
|
||||||
/// Returns a subslice with the suffix removed.
|
/// Returns a subslice with the suffix removed.
|
||||||
///
|
///
|
||||||
/// If the slice ends with `suffix`, returns the subslice before the suffix, wrapped in `Some`.
|
/// 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 the slice does not end with `suffix`, returns `None`.
|
||||||
///
|
///
|
||||||
/// (If `suffix` is empty, simply returns the original slice.)
|
|
||||||
///
|
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue