about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2020-10-12 12:46:17 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2020-10-12 14:48:23 +0100
commit22358c650ba72e29a35076e243d84d47915ff35c (patch)
tree6719133afca82a7a3e6221f8ebf97a8bd3d67c1e
parent6f5e96fb5fcd7fb6c67c61027615abd96a9e5e69 (diff)
downloadrust-22358c650ba72e29a35076e243d84d47915ff35c.tar.gz
rust-22358c650ba72e29a35076e243d84d47915ff35c.zip
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>
-rw-r--r--library/core/src/slice/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 1282bb54f00..4c425ea8da9 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -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
     ///
     /// ```
@@ -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
     ///
     /// ```