diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index d0d88c01f5b2..1dfe899d3e5c 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -1703,8 +1703,12 @@ impl [T] { /// Returns a subslice with the prefix removed. /// - /// This method returns [`None`] if slice does not start with `prefix`. - /// Also it returns the original slice if `prefix` is an empty slice. + /// If the slice starts with `prefix`, returns + /// the subslice after the prefix, wrapped in `Some`. + /// + /// If the slice does not start with `prefix`, returns `None`. + /// + /// (If `prefix` is empty, simply returns the original slice.) /// /// # Examples /// @@ -1734,8 +1738,12 @@ impl [T] { /// Returns a subslice with the suffix removed. /// - /// This method returns [`None`] if slice does not end with `suffix`. - /// Also it returns the original slice if `suffix` is an empty slice + /// If the slice ends with `suffix`, returns + /// the subslice before the suffix, wrapped in `Some`. + /// + /// If the slice does not end with `suffix`, returns `None`. + /// + /// (If `suffix` is empty, simply returns the original slice.) /// /// # Examples ///