From cbe96b04ad9a7109febac47e660d993b45542c1f Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 13 Apr 2020 22:24:58 +0800 Subject: [PATCH] Add period to Pattern docs --- src/liballoc/string.rs | 2 +- src/libcore/str/pattern.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 1e5fe125c55..cc628fe0f0c 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1827,7 +1827,7 @@ fn extend>>(&mut self, iter: I) { } } -/// A convenience impl that delegates to the impl for `&str` +/// A convenience impl that delegates to the impl for `&str`. #[unstable( feature = "pattern", reason = "API not fully fleshed out and ready to be stabilized", diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index 30fd55f7b7f..2f82ba02eb2 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -451,7 +451,7 @@ fn next_match_back(&mut self) -> Option<(usize, usize)> { impl<'a> DoubleEndedSearcher<'a> for CharSearcher<'a> {} -/// Searches for chars that are equal to a given char +/// Searches for chars that are equal to a given `char`. impl<'a> Pattern<'a> for char { type Searcher = CharSearcher<'a>; @@ -696,7 +696,7 @@ unsafe impl<'a, 'b> ReverseSearcher<'a> for CharSliceSearcher<'a, 'b> { impl<'a, 'b> DoubleEndedSearcher<'a> for CharSliceSearcher<'a, 'b> {} -/// Searches for chars that are equal to any of the chars in the array +/// Searches for chars that are equal to any of the chars in the array. impl<'a, 'b> Pattern<'a> for &'b [char] { pattern_methods!(CharSliceSearcher<'a, 'b>, MultiCharEqPattern, CharSliceSearcher); } @@ -738,7 +738,7 @@ unsafe impl<'a, F> ReverseSearcher<'a> for CharPredicateSearcher<'a, F> impl<'a, F> DoubleEndedSearcher<'a> for CharPredicateSearcher<'a, F> where F: FnMut(char) -> bool {} -/// Searches for chars that match the given predicate +/// Searches for chars that match the given predicate. impl<'a, F> Pattern<'a> for F where F: FnMut(char) -> bool, @@ -771,7 +771,7 @@ fn into_searcher(self, haystack: &'a str) -> StrSearcher<'a, 'b> { StrSearcher::new(haystack, self) } - /// Checks whether the pattern matches at the front of the haystack + /// Checks whether the pattern matches at the front of the haystack. #[inline] fn is_prefix_of(self, haystack: &'a str) -> bool { haystack.as_bytes().starts_with(self.as_bytes()) @@ -788,7 +788,7 @@ fn strip_prefix_of(self, haystack: &'a str) -> Option<&'a str> { } } - /// Checks whether the pattern matches at the back of the haystack + /// Checks whether the pattern matches at the back of the haystack. #[inline] fn is_suffix_of(self, haystack: &'a str) -> bool { haystack.as_bytes().ends_with(self.as_bytes()) -- 2.44.0