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.
1 parent 90691c8 commit da7aab6Copy full SHA for da7aab6
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()), Some(5));
970
+ /// assert_eq!(s.find(|c: char| c.is_lowercase()), Some(1));
971
972
973
/// Not finding the pattern:
0 commit comments