Skip to content

Commit

Permalink
Fixed formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SOF3 committed Nov 26, 2019
1 parent 2e2e0df commit 4718e20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3814,7 +3814,8 @@ impl str {
pub fn strip_prefix<'a, P: Pattern<'a>>(&'a self, prefix: P) -> Option<&'a str> {
let mut matcher = prefix.into_searcher(self);
if let SearchStep::Match(start, len) = matcher.next() {
debug_assert_eq!(start, 0, "The first search step from Searcher must start from the front");
debug_assert_eq!(start, 0, "The first search step from Searcher \
must include the first character");
unsafe {
// Searcher is known to return valid indices.
Some(self.get_unchecked(len..))
Expand Down Expand Up @@ -3850,7 +3851,8 @@ impl str {
{
let mut matcher = suffix.into_searcher(self);
if let SearchStep::Match(start, end) = matcher.next_back() {
debug_assert_eq!(end, self.len(), "The first search step from ReverseSearcher must include the last character");
debug_assert_eq!(end, self.len(), "The first search step from ReverseSearcher \
must include the last character");
unsafe {
// Searcher is known to return valid indices.
Some(self.get_unchecked(..start))
Expand Down

0 comments on commit 4718e20

Please sign in to comment.