added non trivial examples of closures for str::find
This commit is contained in:
parent
da7aab6e51
commit
2a889eb945
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue