about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-10-19 18:22:15 +0000
committerbors <bors@rust-lang.org>2017-10-19 18:22:15 +0000
commit439f7521b87161908afaace97204d7a0b3438e19 (patch)
tree01b3e31e94f47ce91e45c0e3933f6c5706ad6817 /src/liballoc
parent8b45c24b510e80a77c01881736ed0fad8770850e (diff)
parent437186217ba37d52da9f657e78b56874a010cd98 (diff)
downloadrust-439f7521b87161908afaace97204d7a0b3438e19.tar.gz
rust-439f7521b87161908afaace97204d7a0b3438e19.zip
Auto merge of #45386 - kennytm:rollup, r=kennytm
Rollup of 8 pull requests

- Successful merges: #45343, #45349, #45352, #45374, #45375, #45376, #45377, #45382
- Failed merges:
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/str.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs
index 830128f2b9f..895607ff8d4 100644
--- a/src/liballoc/str.rs
+++ b/src/liballoc/str.rs
@@ -959,13 +959,15 @@ impl str {
     /// assert_eq!(s.find("Léopard"), Some(13));
     /// ```
     ///
-    /// More complex patterns with closures:
+    /// More complex patterns using point-free style and closures:
     ///
     /// ```
     /// let s = "Löwe 老虎 Léopard";
     ///
     /// assert_eq!(s.find(char::is_whitespace), Some(5));
     /// assert_eq!(s.find(char::is_lowercase), Some(1));
+    /// assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
+    /// assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
     /// ```
     ///
     /// Not finding the pattern: