Skip to content

Commit 22358c6

Browse files
committed
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 <[email protected]>
1 parent 6f5e96f commit 22358c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

library/core/src/slice/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,10 @@ impl<T> [T] {
17041704
/// Returns a subslice with the prefix removed.
17051705
///
17061706
/// If the slice starts with `prefix`, returns the subslice after the prefix, wrapped in `Some`.
1707+
/// If `prefix` is empty, simply returns the original slice.
17071708
///
17081709
/// If the slice does not start with `prefix`, returns `None`.
17091710
///
1710-
/// (If `prefix` is empty, simply returns the original slice.)
1711-
///
17121711
/// # Examples
17131712
///
17141713
/// ```
@@ -1738,11 +1737,10 @@ impl<T> [T] {
17381737
/// Returns a subslice with the suffix removed.
17391738
///
17401739
/// If the slice ends with `suffix`, returns the subslice before the suffix, wrapped in `Some`.
1740+
/// If `suffix` is empty, simply returns the original slice.
17411741
///
17421742
/// If the slice does not end with `suffix`, returns `None`.
17431743
///
1744-
/// (If `suffix` is empty, simply returns the original slice.)
1745-
///
17461744
/// # Examples
17471745
///
17481746
/// ```

0 commit comments

Comments
 (0)