File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ use tables::grapheme::GraphemeCat;
29
29
30
30
/// An iterator over the words of a string, separated by a sequence of whitespace
31
31
/// FIXME: This should be opaque
32
- pub type Words < ' a > =
33
- Filter < ' a , & ' a str , CharSplits < ' a , |char |: ' a -> bool >>;
32
+ pub type Words < ' a > = Filter < & ' a str , CharSplits < ' a , |char |: ' a -> bool > , fn ( & & str ) -> bool > ;
34
33
35
34
/// Methods for Unicode string slices
36
35
pub trait UnicodeStrPrelude for Sized ? {
@@ -143,8 +142,9 @@ impl UnicodeStrPrelude for str {
143
142
144
143
#[ inline]
145
144
fn words ( & self ) -> Words {
145
+ fn is_not_empty ( s : & & str ) -> bool { !s. is_empty ( ) }
146
146
let f = |c : char | c. is_whitespace ( ) ;
147
- self . split ( f) . filter ( |s| !s . is_empty ( ) )
147
+ self . split ( f) . filter ( is_not_empty )
148
148
}
149
149
150
150
#[ inline]
You can’t perform that action at this time.
0 commit comments