提交 2a889eb9 编写于 作者: C Christian Poveda

added non trivial examples of closures for str::find

上级 da7aab6e
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册