Skip to content

Commit 8fe79bd

Browse files
committed
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.
2 parents f0666b4 + 30fbf44 commit 8fe79bd

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/libcollections/str.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ impl str {
715715
/// Returns `None` if it doesn't exist.
716716
///
717717
/// The pattern can be a simple `&str`, `char`, or a closure that
718-
/// determines the
719-
/// split.
718+
/// determines if a character matches.
720719
///
721720
/// # Examples
722721
///
@@ -760,7 +759,7 @@ impl str {
760759
/// Returns `None` if it doesn't exist.
761760
///
762761
/// The pattern can be a simple `&str`, `char`,
763-
/// or a closure that determines the split.
762+
/// or a closure that determines if a character matches.
764763
///
765764
/// # Examples
766765
///
@@ -1096,7 +1095,7 @@ impl str {
10961095
/// An iterator over the matches of a pattern within `self`.
10971096
///
10981097
/// The pattern can be a simple `&str`, `char`, or a closure that
1099-
/// determines the split.
1098+
/// determines if a character matches.
11001099
/// Additional libraries might provide more complex patterns like
11011100
/// regular expressions.
11021101
///
@@ -1129,7 +1128,7 @@ impl str {
11291128
/// reverse order.
11301129
///
11311130
/// The pattern can be a simple `&str`, `char`, or a closure that
1132-
/// determines the split.
1131+
/// determines if a character matches.
11331132
/// Additional libraries might provide more complex patterns like
11341133
/// regular expressions.
11351134
///
@@ -1166,8 +1165,7 @@ impl str {
11661165
/// match are returned.
11671166
///
11681167
/// The pattern can be a simple `&str`, `char`, or a closure that
1169-
/// determines
1170-
/// the split.
1168+
/// determines if a character matches.
11711169
/// Additional libraries might provide more complex patterns like
11721170
/// regular expressions.
11731171
///
@@ -1214,8 +1212,7 @@ impl str {
12141212
/// match are returned.
12151213
///
12161214
/// The pattern can be a simple `&str`, `char`, or a closure that
1217-
/// determines
1218-
/// the split.
1215+
/// determines if a character matches.
12191216
/// Additional libraries might provide more complex patterns like
12201217
/// regular expressions.
12211218
///
@@ -1296,7 +1293,7 @@ impl str {
12961293
/// repeatedly removed.
12971294
///
12981295
/// The pattern can be a simple `char`, or a closure that determines
1299-
/// the split.
1296+
/// if a character matches.
13001297
///
13011298
/// # Examples
13021299
///
@@ -1326,7 +1323,7 @@ impl str {
13261323
/// repeatedly removed.
13271324
///
13281325
/// The pattern can be a simple `&str`, `char`, or a closure that
1329-
/// determines the split.
1326+
/// determines if a character matches.
13301327
///
13311328
/// # Examples
13321329
///
@@ -1346,7 +1343,7 @@ impl str {
13461343
/// repeatedly removed.
13471344
///
13481345
/// The pattern can be a simple `&str`, `char`, or a closure that
1349-
/// determines the split.
1346+
/// determines if a character matches.
13501347
///
13511348
/// # Examples
13521349
///

0 commit comments

Comments
 (0)