Skip to content

Commit 2a889eb

Browse files
committed
added non trivial examples of closures for str::find
1 parent da7aab6 commit 2a889eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/liballoc/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,8 @@ impl str {
966966
///
967967
/// assert_eq!(s.find(char::is_whitespace), Some(5));
968968
/// assert_eq!(s.find(char::is_lowercase), Some(1));
969-
/// assert_eq!(s.find(|c: char| c.is_whitespace()), Some(5));
970-
/// assert_eq!(s.find(|c: char| c.is_lowercase()), Some(1));
969+
/// assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
970+
/// assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
971971
/// ```
972972
///
973973
/// Not finding the pattern:

0 commit comments

Comments
 (0)