about summary refs log tree commit diff
path: root/src/liballoc/str.rs
diff options
context:
space:
mode:
authorChristian Poveda <christianpoveda@protonmail.com>2017-10-17 23:51:27 -0500
committerChristian Poveda <christianpoveda@protonmail.com>2017-10-17 23:51:27 -0500
commit2a889eb945cdae95fce33fbeb1b79093c456cadd (patch)
tree76abf8639add8ef8abd33e9122d97cc1d9caa885 /src/liballoc/str.rs
parentda7aab6e51fd06ea6628324b3be5ab88a4abda4f (diff)
downloadrust-2a889eb945cdae95fce33fbeb1b79093c456cadd.tar.gz
rust-2a889eb945cdae95fce33fbeb1b79093c456cadd.zip
added non trivial examples of closures for str::find
Diffstat (limited to 'src/liballoc/str.rs')
-rw-r--r--src/liballoc/str.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs
index 3e273a67000..895607ff8d4 100644
--- a/src/liballoc/str.rs
+++ b/src/liballoc/str.rs
@@ -966,8 +966,8 @@ impl str {
     ///
     /// 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()), Some(5));
-    /// assert_eq!(s.find(|c: char| c.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: