added non trivial examples of closures for str::find

This commit is contained in:
Christian Poveda 2017-10-17 23:51:27 -05:00
parent da7aab6e51
commit 2a889eb945

View File

@ -966,8 +966,8 @@ pub fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
///
/// 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: