added non trivial examples of closures for str::find
This commit is contained in:
parent
da7aab6e51
commit
2a889eb945
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user