We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7da795b + 2a889eb commit 207dab5Copy full SHA for 207dab5
src/liballoc/str.rs
@@ -959,13 +959,15 @@ impl str {
959
/// assert_eq!(s.find("Léopard"), Some(13));
960
/// ```
961
///
962
- /// More complex patterns with closures:
+ /// More complex patterns using point-free style and closures:
963
964
965
/// let s = "Löwe 老虎 Léopard";
966
967
/// assert_eq!(s.find(char::is_whitespace), Some(5));
968
/// assert_eq!(s.find(char::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));
971
972
973
/// Not finding the pattern:
0 commit comments