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] { /// 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] { /// 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 /// /// ```