Skip to content

Commit

Permalink
Move comments for tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
foeb committed Jan 17, 2020
1 parent ca2fae8 commit c103c28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1301,9 +1301,9 @@ where
impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
#[inline]
fn next(&mut self) -> Option<(usize, &'a str)> {
// SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
self.0
.next_match()
// SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
.map(|(start, end)| unsafe { (start, self.0.haystack().get_unchecked(start..end)) })
}

Expand All @@ -1312,9 +1312,9 @@ impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
where
P::Searcher: ReverseSearcher<'a>,
{
// SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
self.0
.next_match_back()
// SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
.map(|(start, end)| unsafe { (start, self.0.haystack().get_unchecked(start..end)) })
}
}
Expand Down Expand Up @@ -3901,8 +3901,8 @@ impl str {
"The first search step from Searcher \
must include the first character"
);
// SAFETY: `Searcher` is known to return valid indices.
unsafe {
// Searcher is known to return valid indices.
Some(self.get_unchecked(len..))
}
} else {
Expand Down Expand Up @@ -3942,8 +3942,8 @@ impl str {
"The first search step from ReverseSearcher \
must include the last character"
);
// SAFETY: `Searcher` is known to return valid indices.
unsafe {
// Searcher is known to return valid indices.
Some(self.get_unchecked(..start))
}
} else {
Expand Down Expand Up @@ -4381,8 +4381,8 @@ impl Default for &str {
#[stable(feature = "default_mut_str", since = "1.28.0")]
impl Default for &mut str {
/// Creates an empty mutable str
// SAFETY: `str` is guranteed to be UTF-8.
fn default() -> Self {
// SAFETY: The empty string is valid UTF-8.
unsafe { from_utf8_unchecked_mut(&mut []) }
}
}
Expand Down

0 comments on commit c103c28

Please sign in to comment.