提交 8fe79bdf 编写于 作者: B bors

Auto merge of #28607 - remram44:doc-fix-str-pattern, r=alexcrichton

Reported by Moonlightning on #rust
> 17:13 EDT < Moonlightning> I think I found a bug in the str::matches() documentation. Was it copied from str::split()? :p
> 17:13 EDT < Moonlightning> Because it says “The pattern can be a simple `&str`, `char`, or a closure that determines the split.”

I changed "determines the split" to "determines if a character matches".

It's not super clear, "determines the split" is not super clear to begin with, maybe this can be made better? On the other hand following the link to Pattern provides enough details.
......@@ -715,8 +715,7 @@ pub fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
/// Returns `None` if it doesn't exist.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the
/// split.
/// determines if a character matches.
///
/// # Examples
///
......@@ -760,7 +759,7 @@ pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> {
/// Returns `None` if it doesn't exist.
///
/// The pattern can be a simple `&str`, `char`,
/// or a closure that determines the split.
/// or a closure that determines if a character matches.
///
/// # Examples
///
......@@ -1096,7 +1095,7 @@ pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a
/// An iterator over the matches of a pattern within `self`.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
......@@ -1129,7 +1128,7 @@ pub fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P> {
/// reverse order.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
......@@ -1166,8 +1165,7 @@ pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
/// match are returned.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines
/// the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
......@@ -1214,8 +1212,7 @@ pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P
/// match are returned.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines
/// the split.
/// determines if a character matches.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
......@@ -1296,7 +1293,7 @@ pub fn trim_right(&self) -> &str {
/// repeatedly removed.
///
/// The pattern can be a simple `char`, or a closure that determines
/// the split.
/// if a character matches.
///
/// # Examples
///
......@@ -1326,7 +1323,7 @@ pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
/// repeatedly removed.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
///
/// # Examples
///
......@@ -1346,7 +1343,7 @@ pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
/// repeatedly removed.
///
/// The pattern can be a simple `&str`, `char`, or a closure that
/// determines the split.
/// determines if a character matches.
///
/// # Examples
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册